Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets: Option to choose betwen w/b and color display #97

Open
rugk opened this issue Jul 14, 2016 · 6 comments
Open

Widgets: Option to choose betwen w/b and color display #97

rugk opened this issue Jul 14, 2016 · 6 comments

Comments

@rugk
Copy link

rugk commented Jul 14, 2016

I think for dark backgrounds it would also be useful to have the black/white display in the Widget. It should be choosable per widget.

@tom-anders
Copy link
Owner

Unfortunately it seems like it's not possible to apply the color filter I use to the Widget's Image, since Android handles Widgets in quite a weird way :/

@PeterHindes
Copy link
Contributor

Also Related to this. the alt text in the widget is un-readable on dark backgrounds.

@PeterHindes
Copy link
Contributor

im working on a fix, dont get your hopes up though

@PeterHindes
Copy link
Contributor

if tom wouldn't mind walking me through how images are loaded into the widget

@tom-anders
Copy link
Owner

tom-anders commented Jan 10, 2020

Basically, the layout contains an image view

<ImageView
android:id="@+id/ivComic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/tvTitle"
android:layout_above="@+id/tvAlt"
android:layout_gravity="center"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp" />

and I use Glide to load the images into it:
if (comic != null) {
newestComicNumber = comic.getComicNumber();
GlideApp.with(context)
.asBitmap()
.load(comic.getUrl())
.into(appWidgetTarget);
String title = prefHelper.widgetShowComicNumber() ? (newestComicNumber + ": ") : "";
remoteViews.setTextViewText(R.id.tvTitle, title + comic.getTitle());
remoteViews.setTextViewText(R.id.tvAlt, comic.getAltText());
if (prefHelper.widgetShowAlt())
remoteViews.setViewVisibility(R.id.tvAlt, View.VISIBLE);
}

@PeterHindes
Copy link
Contributor

Is that the same process that the main app uses? Where does the inversion happen usually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants