mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
fixes #466. Setting the background image provides for a image that is sufficiently large to fit portrait and landscape orientations. When displayed the shorter side is scaled to fit, the larger is then centered and cropped.
This commit is contained in:
parent
bfa08887e2
commit
16f5c6d889
3 changed files with 18 additions and 8 deletions
|
@ -175,6 +175,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
private InputAwareLayout container;
|
||||
private View composePanel;
|
||||
protected Stub<ReminderView> reminderView;
|
||||
private ImageView backgroundView;
|
||||
|
||||
private AttachmentTypeSelector attachmentTypeSelector;
|
||||
private AttachmentManager attachmentManager;
|
||||
|
@ -798,6 +799,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
quickAttachmentDrawer = ViewUtil.findById(this, R.id.quick_attachment_drawer);
|
||||
quickAttachmentToggle = ViewUtil.findById(this, R.id.quick_attachment_toggle);
|
||||
inputPanel = ViewUtil.findById(this, R.id.bottom_panel);
|
||||
backgroundView = ViewUtil.findById(this, R.id.conversation_background);
|
||||
|
||||
ImageButton quickCameraToggle = ViewUtil.findById(this, R.id.quick_camera_toggle);
|
||||
|
||||
|
@ -842,13 +844,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
String backgroundImagePath = Prefs.getBackgroundImagePath(this);
|
||||
if(!backgroundImagePath.isEmpty()) {
|
||||
Drawable image = Drawable.createFromPath(backgroundImagePath);
|
||||
getWindow().setBackgroundDrawable(image);
|
||||
backgroundView.setImageDrawable(image);
|
||||
}
|
||||
else if(dynamicTheme.isDarkTheme(this)) {
|
||||
getWindow().setBackgroundDrawableResource(R.drawable.background_hd_dark);
|
||||
backgroundView.setImageResource(R.drawable.background_hd_dark);
|
||||
}
|
||||
else {
|
||||
getWindow().setBackgroundDrawableResource(R.drawable.background_hd);
|
||||
backgroundView.setImageResource(R.drawable.background_hd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue