-
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use one Glide instance per NewsListRecyclerAdapter
Signed-off-by: Unpublished <unpublished@gmx.net>
- Loading branch information
1 parent
9faaf90
commit 8d97c0a
Showing
10 changed files
with
1,206 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 46 additions & 51 deletions
97
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemCardViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,70 @@ | ||
package de.luhmer.owncloudnewsreader.adapter; | ||
package de.luhmer.owncloudnewsreader.adapter | ||
|
||
import android.content.SharedPreferences; | ||
import android.view.View; | ||
import android.widget.FrameLayout; | ||
import android.widget.ImageView; | ||
import android.widget.ProgressBar; | ||
import android.widget.TextView; | ||
import android.content.SharedPreferences | ||
import android.view.View | ||
import android.widget.FrameLayout | ||
import android.widget.ImageView | ||
import android.widget.ProgressBar | ||
import android.widget.TextView | ||
import androidx.annotation.CallSuper | ||
import com.bumptech.glide.RequestManager | ||
import de.luhmer.owncloudnewsreader.database.model.RssItem | ||
import de.luhmer.owncloudnewsreader.databinding.SubscriptionDetailListItemCardViewBinding | ||
import de.luhmer.owncloudnewsreader.helper.FavIconHandler | ||
|
||
import androidx.annotation.CallSuper; | ||
import androidx.annotation.NonNull; | ||
|
||
import de.luhmer.owncloudnewsreader.database.model.RssItem; | ||
import de.luhmer.owncloudnewsreader.databinding.SubscriptionDetailListItemCardViewBinding; | ||
|
||
public class RssItemCardViewHolder extends RssItemViewHolder<SubscriptionDetailListItemCardViewBinding> { | ||
RssItemCardViewHolder(@NonNull SubscriptionDetailListItemCardViewBinding binding, SharedPreferences sharedPreferences) { | ||
super(binding, sharedPreferences); | ||
} | ||
|
||
@Override | ||
protected ImageView getImageViewFavIcon() { | ||
return binding.imgViewFavIcon; | ||
class RssItemCardViewHolder internal constructor( | ||
binding: SubscriptionDetailListItemCardViewBinding, | ||
faviconHandler: FavIconHandler, | ||
glide: RequestManager, | ||
sharedPreferences: SharedPreferences, | ||
) : RssItemViewHolder<SubscriptionDetailListItemCardViewBinding>( | ||
binding, | ||
faviconHandler, | ||
glide, | ||
sharedPreferences, | ||
) { | ||
override fun getImageViewFavIcon(): ImageView { | ||
return binding.imgViewFavIcon | ||
} | ||
|
||
@Override | ||
protected ImageView getStar() { | ||
return binding.starImageview; | ||
override fun getStar(): ImageView { | ||
return binding.starImageview | ||
} | ||
|
||
@Override | ||
protected ImageView getPlayPausePodcastButton() { | ||
return binding.podcastWrapper.btnPlayPausePodcast; | ||
override fun getPlayPausePodcastButton(): ImageView { | ||
return binding.podcastWrapper.btnPlayPausePodcast | ||
} | ||
|
||
@Override | ||
protected View getColorFeed() { | ||
return binding.colorLineFeed; | ||
override fun getColorFeed(): View { | ||
return binding.colorLineFeed | ||
} | ||
|
||
@Override | ||
protected TextView getTextViewTitle() { | ||
return binding.tvSubscription; | ||
override fun getTextViewTitle(): TextView { | ||
return binding.tvSubscription | ||
} | ||
|
||
@Override | ||
protected TextView getTextViewSummary() { | ||
return binding.summary; | ||
override fun getTextViewSummary(): TextView { | ||
return binding.summary | ||
} | ||
|
||
@Override | ||
protected TextView getTextViewBody() { | ||
return binding.body; | ||
override fun getTextViewBody(): TextView { | ||
return binding.body | ||
} | ||
|
||
@Override | ||
protected TextView getTextViewItemDate() { | ||
return binding.tvItemDate; | ||
override fun getTextViewItemDate(): TextView { | ||
return binding.tvItemDate | ||
} | ||
|
||
@Override | ||
protected FrameLayout getPlayPausePodcastWrapper() { | ||
return binding.podcastWrapper.flPlayPausePodcastWrapper; | ||
override fun getPlayPausePodcastWrapper(): FrameLayout { | ||
return binding.podcastWrapper.flPlayPausePodcastWrapper | ||
} | ||
|
||
@Override | ||
protected ProgressBar getPodcastDownloadProgress() { | ||
return binding.podcastWrapper.podcastDownloadProgress; | ||
override fun getPodcastDownloadProgress(): ProgressBar { | ||
return binding.podcastWrapper.podcastDownloadProgress | ||
} | ||
|
||
@CallSuper | ||
public void bind(@NonNull RssItem rssItem) { | ||
super.bind(rssItem); | ||
override fun bind(rssItem: RssItem) { | ||
super.bind(rssItem) | ||
} | ||
} | ||
} |
26 changes: 13 additions & 13 deletions
26
...droid-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemFullTextViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package de.luhmer.owncloudnewsreader.adapter; | ||
|
||
import android.content.SharedPreferences; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import de.luhmer.owncloudnewsreader.databinding.SubscriptionDetailListItemTextBinding; | ||
|
||
public class RssItemFullTextViewHolder extends RssItemTextViewHolder { | ||
RssItemFullTextViewHolder(@NonNull SubscriptionDetailListItemTextBinding binding, SharedPreferences sharedPreferences) { | ||
super(binding, sharedPreferences); | ||
} | ||
} | ||
package de.luhmer.owncloudnewsreader.adapter | ||
|
||
import android.content.SharedPreferences | ||
import com.bumptech.glide.RequestManager | ||
import de.luhmer.owncloudnewsreader.databinding.SubscriptionDetailListItemTextBinding | ||
import de.luhmer.owncloudnewsreader.helper.FavIconHandler | ||
|
||
class RssItemFullTextViewHolder internal constructor( | ||
binding: SubscriptionDetailListItemTextBinding, | ||
faviconHandler: FavIconHandler, | ||
glide: RequestManager, | ||
sharedPreferences: SharedPreferences, | ||
) : RssItemTextViewHolder(binding, faviconHandler, glide, sharedPreferences) |
Oops, something went wrong.