Browse Source

Improved layout

main
M66B 6 years ago
parent
commit
ede8a4e563
2 changed files with 8 additions and 4 deletions
  1. +6
    -2
      app/src/main/java/eu/faircode/email/FragmentMessage.java
  2. +2
    -2
      app/src/main/res/layout/fragment_message.xml

+ 6
- 2
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -214,6 +214,7 @@ public class FragmentMessage extends FragmentEx {
grpHeader.setVisibility(free ? View.GONE : View.VISIBLE);
grpAddresses.setVisibility(View.GONE);
grpAttachments.setVisibility(View.GONE);
top_navigation.setVisibility(View.GONE);
tvCount.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
fab.setVisibility(View.GONE);
@ -229,6 +230,7 @@ public class FragmentMessage extends FragmentEx {
grpHeader.setVisibility(free ? View.GONE : View.VISIBLE);
grpAddresses.setVisibility((int) tvCc.getTag());
rvAttachment.setVisibility((int) rvAttachment.getTag());
top_navigation.setVisibility(View.VISIBLE);
tvCount.setVisibility((int) tvCount.getTag());
tvError.setVisibility((int) tvError.getTag());
fab.setVisibility(View.VISIBLE);
@ -266,7 +268,9 @@ public class FragmentMessage extends FragmentEx {
grpHeader.setVisibility(View.GONE);
grpAddresses.setVisibility(View.GONE);
grpAttachments.setVisibility(View.GONE);
top_navigation.setVisibility(View.GONE);
grpMessage.setVisibility(View.GONE);
bottom_navigation.setVisibility(View.GONE);
tvCount.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
fab.setVisibility(View.GONE);
@ -354,6 +358,8 @@ public class FragmentMessage extends FragmentEx {
@Override
protected void onLoaded(Bundle args, Spanned body) {
tvBody.setText(body);
grpMessage.setVisibility(View.VISIBLE);
fab.setVisibility(View.VISIBLE);
}
}.load(FragmentMessage.this, args);
@ -416,10 +422,8 @@ public class FragmentMessage extends FragmentEx {
grpHeader.setVisibility(free ? View.GONE : View.VISIBLE);
if (free)
grpAddresses.setVisibility(View.GONE);
grpMessage.setVisibility(View.VISIBLE);
tvCount.setVisibility(!free && message.count > 1 ? View.VISIBLE : View.GONE);
tvError.setVisibility(free || message.error == null ? View.GONE : View.VISIBLE);
fab.setVisibility(free ? View.GONE : View.VISIBLE);
}
}
});


+ 2
- 2
app/src/main/res/layout/fragment_message.xml View File

@ -274,7 +274,7 @@
android:id="@+id/grpHeader"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvFrom,tvToTitle,tvTo,tvTime,tvSubject,top_navigation" />
app:constraint_referenced_ids="tvFrom,tvToTitle,tvTo,tvTime,tvSubject" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpAddresses"
@ -292,5 +292,5 @@
android:id="@+id/grpMessage"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="scroll,bottom_navigation" />
app:constraint_referenced_ids="scroll" />
</androidx.constraintlayout.widget.ConstraintLayout>

Loading…
Cancel
Save