Fix recent chapters menu button not showing on high dpi screens

This commit is contained in:
len 2016-05-05 20:58:19 +02:00
parent 0de214c3b5
commit 9de3da33aa
3 changed files with 6 additions and 13 deletions

View File

@ -57,15 +57,12 @@ class DownloadManager(private val context: Context, private val sourceManager: S
.lift(DynamicConcurrentMergeOperator<Download, Download>({ downloadChapter(it) }, threadsSubject)) .lift(DynamicConcurrentMergeOperator<Download, Download>({ downloadChapter(it) }, threadsSubject))
.onBackpressureBuffer() .onBackpressureBuffer()
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnNext { .subscribe({
// Delete successful downloads from queue // Delete successful downloads from queue
if (it.status == Download.DOWNLOADED) { if (it.status == Download.DOWNLOADED) {
queue.del(it) queue.del(it)
} }
} if (areAllDownloadsFinished()) {
.map { download -> areAllDownloadsFinished() }
.subscribe({ finished ->
if (finished!!) {
DownloadService.stop(context) DownloadService.stop(context)
} }
}, { e -> }, { e ->

View File

@ -40,7 +40,7 @@ class RecentChaptersHolder(view: View, private val adapter: RecentChaptersAdapte
// We need to post a Runnable to show the popup to make sure that the PopupMenu is // We need to post a Runnable to show the popup to make sure that the PopupMenu is
// correctly positioned. The reason being that the view may change position before the // correctly positioned. The reason being that the view may change position before the
// PopupMenu is shown. // PopupMenu is shown.
itemView.chapterMenu.setOnClickListener { it.post({ showPopupMenu(it) }) } itemView.chapter_menu.setOnClickListener { it.post({ showPopupMenu(it) }) }
} }
/** /**

View File

@ -76,20 +76,16 @@
android:gravity="center|end" android:gravity="center|end"
android:paddingBottom="18dp" android:paddingBottom="18dp"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingRight="?android:attr/listPreferredItemPaddingRight" android:paddingRight="?android:attr/listPreferredItemPaddingRight">
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft">
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
android:id="@+id/chapterMenu"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_alignParentEnd="false" android:layout_alignParentEnd="false"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="?android:selectableItemBackground" android:tint="?android:attr/textColorPrimary"
app:srcCompat="@drawable/ic_more_horiz_black_24dp" app:srcCompat="@drawable/ic_more_horiz_black_24dp"/>
android:tint="?android:attr/textColorPrimary"/>
</RelativeLayout> </RelativeLayout>