Skip to content

Commit

Permalink
[Performance] Update a-navigator for optimized memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rh-id committed Dec 17, 2021
1 parent 7791119 commit 261f46d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public RssItemDetailPage(RssItem rssItem) {

@Override
protected View createView(Activity activity, ViewGroup container) {
int layoutId = R.layout.page_rss_item_detail;
if (mSvProvider != null) {
mSvProvider.dispose();
}
mSvProvider = mProvider.get(StatefulViewProvider.class);
int layoutId = R.layout.page_rss_item_detail;
AppSharedPreferences appSharedPreferences = mSvProvider.get(AppSharedPreferences.class);
if (appSharedPreferences.isOneHandMode()) {
layoutId = R.layout.one_hand_mode_page_rss_item_detail;
Expand All @@ -72,10 +72,10 @@ protected View createView(Activity activity, ViewGroup container) {
Button fabOpenLink = view.findViewById(R.id.fab_open_link);
fabOpenLink.setOnClickListener(this);
if (mRssChannel == null) {
RssDao rssDao = mSvProvider.get(RssDao.class);
mSvProvider.get(RxDisposer.class).add("getRssChannel",
Single.fromCallable(() ->
rssDao.findRssChannelById(mRssItem.channelId))
mSvProvider.get(RssDao.class)
.findRssChannelById(mRssItem.channelId))
.subscribeOn(Schedulers.from(mSvProvider.get(ExecutorService.class)))
.observeOn(AndroidSchedulers.mainThread())
.subscribe((rssChannel, throwable) -> {
Expand Down
2 changes: 1 addition & 1 deletion base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {

api 'com.android.volley:volley:1.2.1'
api 'com.github.rh-id:a-provider:v0.0.15'
api 'com.github.rh-id:a-navigator:v0.0.34'
api 'com.github.rh-id:a-navigator:v0.0.37'
api 'com.github.rh-id:a-logger:v0.0.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'junit:junit:4.13.2'
Expand Down

0 comments on commit 261f46d

Please sign in to comment.