mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
MessageView: another theme fix
- The attachments view still had the wrong background color in case of different global and message themes. - The attachments view used the activity LayoutInflater, but it needs to use the one of the fragment. - The background drawable for the attachments used transparency, and thus was completely invisible in the black theme. Fix it by adding another one for the black theme.
This commit is contained in:
parent
f5ec5cd3fb
commit
5fa7e65816
BIN
res/drawable/attachment_text_box_dark.9.png
Normal file
BIN
res/drawable/attachment_text_box_dark.9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 542 B |
Before Width: | Height: | Size: 652 B After Width: | Height: | Size: 652 B |
@ -18,7 +18,7 @@
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_width="1dip"
|
||||
android:layout_height="42dip"
|
||||
android:background="@drawable/text_box"
|
||||
android:background="?attr/messageViewAttachmentBackground"
|
||||
android:paddingLeft="36dip"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="start"
|
||||
|
@ -11,7 +11,7 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/text_box"
|
||||
android:background="?attr/messageViewAttachmentBackground"
|
||||
android:gravity="center_vertical">
|
||||
<ImageView
|
||||
android:id="@+id/attachment_icon"
|
||||
|
@ -51,6 +51,7 @@
|
||||
<attr name="messageListActiveItemBackgroundColor" format="reference|color"/>
|
||||
<attr name="messageListDividerColor" format="reference|color"/>
|
||||
<attr name="messageViewHeaderBackgroundColor" format="reference|color"/>
|
||||
<attr name="messageViewAttachmentBackground" format="reference"/>
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
|
@ -50,6 +50,7 @@
|
||||
<item name="messageListActiveItemBackgroundColor">#ff2ea7d1</item>
|
||||
<item name="messageListDividerColor">#ffcccccc</item>
|
||||
<item name="messageViewHeaderBackgroundColor">#ffffffff</item>
|
||||
<item name="messageViewAttachmentBackground">@drawable/attachment_text_box_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.K9.Dark.Base" parent="Theme.Sherlock">
|
||||
@ -102,6 +103,7 @@
|
||||
<item name="messageListActiveItemBackgroundColor">#ff33b5e5</item>
|
||||
<item name="messageListDividerColor">#ff333333</item>
|
||||
<item name="messageViewHeaderBackgroundColor">#000000</item>
|
||||
<item name="messageViewAttachmentBackground">@drawable/attachment_text_box_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.K9.Light" parent="Theme.K9.Light.Base">
|
||||
|
@ -77,6 +77,7 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
|
||||
private MessagingController mController;
|
||||
private Listener mListener = new Listener();
|
||||
private MessageViewHandler mHandler = new MessageViewHandler();
|
||||
private LayoutInflater mLayoutInflater;
|
||||
|
||||
/** this variable is used to save the calling AttachmentView
|
||||
* until the onActivityResult is called.
|
||||
@ -172,8 +173,8 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
|
||||
Bundle savedInstanceState) {
|
||||
Context context = new ContextThemeWrapper(getActivity().getApplicationContext(),
|
||||
K9.getK9ThemeResourceId(K9.getK9MessageViewTheme()));
|
||||
LayoutInflater localInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
View view = localInflater.inflate(R.layout.message, container, false);
|
||||
mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
View view = mLayoutInflater.inflate(R.layout.message, container, false);
|
||||
|
||||
|
||||
mMessageView = (SingleMessageView) view.findViewById(R.id.message_view);
|
||||
@ -833,4 +834,8 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
|
||||
public boolean isInitialized() {
|
||||
return mInitialized ;
|
||||
}
|
||||
|
||||
public LayoutInflater getFragmentLayoutInflater() {
|
||||
return mLayoutInflater;
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import com.fsck.k9.controller.MessagingController;
|
||||
import com.fsck.k9.controller.MessagingListener;
|
||||
import com.fsck.k9.crypto.CryptoProvider;
|
||||
import com.fsck.k9.crypto.PgpData;
|
||||
import com.fsck.k9.fragment.MessageViewFragment;
|
||||
import com.fsck.k9.helper.ClipboardManager;
|
||||
import com.fsck.k9.helper.Contacts;
|
||||
import com.fsck.k9.helper.HtmlConverter;
|
||||
@ -141,7 +142,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
||||
|
||||
mContacts = Contacts.getInstance(activity);
|
||||
|
||||
mInflater = activity.getLayoutInflater();
|
||||
mInflater = ((MessageViewFragment) fragment).getFragmentLayoutInflater();
|
||||
mDownloadRemainder = (Button) findViewById(R.id.download_remainder);
|
||||
mDownloadRemainder.setVisibility(View.GONE);
|
||||
mAttachmentsContainer.setVisibility(View.GONE);
|
||||
@ -162,6 +163,8 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
||||
TypedValue outValue = new TypedValue();
|
||||
getContext().getTheme().resolveAttribute(R.attr.messageViewHeaderBackgroundColor, outValue, true);
|
||||
mHeaderContainer.setBackgroundColor(outValue.data);
|
||||
// also set background of the whole view (including the attachments view)
|
||||
setBackgroundColor(outValue.data);
|
||||
|
||||
mTitleBarHeaderContainer = new LinearLayout(activity);
|
||||
mMessageContentView.setEmbeddedTitleBarCompat(mTitleBarHeaderContainer);
|
||||
|
Loading…
Reference in New Issue
Block a user