Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.

Commit 88b1976

Browse files
authored
Use SVG icons in place of PNG (#417)
1 parent 53cafe1 commit 88b1976

File tree

57 files changed

+313
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+313
-61
lines changed

r2-testapp/src/main/java/org/readium/r2/testapp/epub/UserSettings.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -398,21 +398,9 @@ class UserSettings(var preferences: SharedPreferences, val context: Context, pri
398398
}
399399
} ?: run {
400400
alignmentRadios[alignment.index].isChecked = true
401-
alignmentRadios[0].setCompoundDrawablesWithIntrinsicBounds(null,
402-
(if (alignment.index == 0) context.getDrawable(R.drawable.icon_justify_white) else context.getDrawable(R.drawable.icon_justify)),
403-
null, null)
404-
alignmentRadios[1].setCompoundDrawablesWithIntrinsicBounds(null,
405-
(if (alignment.index == 0) context.getDrawable(R.drawable.icon_left) else context.getDrawable(R.drawable.icon_left_white)),
406-
null, null)
407401

408402
alignmentGroup.setOnCheckedChangeListener { _, i ->
409403
alignment.index = findIndexOfId(i, alignmentRadios)
410-
alignmentRadios[0].setCompoundDrawablesWithIntrinsicBounds(null,
411-
(if (alignment.index == 0) context.getDrawable(R.drawable.icon_justify_white) else context.getDrawable(R.drawable.icon_justify)),
412-
null, null)
413-
alignmentRadios[1].setCompoundDrawablesWithIntrinsicBounds(null,
414-
(if (alignment.index == 0) context.getDrawable(R.drawable.icon_left) else context.getDrawable(R.drawable.icon_left_white)),
415-
null, null)
416404
publisherDefaultSwitch.isChecked = false
417405
updateEnumerable(alignment)
418406
updateViewCSS(TEXT_ALIGNMENT_REF)

r2-testapp/src/main/java/org/readium/r2/testapp/outline/BookmarksFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class BookmarkAdapter(private val publication: Publication, private val onBookma
114114

115115
bookmarkOverflow.setOnClickListener {
116116

117-
val popupMenu = PopupMenu(bookmarkOverflow.context, bookmarkChapter)
117+
val popupMenu = PopupMenu(bookmarkOverflow.context, bookmarkOverflow)
118118
popupMenu.menuInflater.inflate(R.menu.menu_bookmark, popupMenu.menu)
119119
popupMenu.show()
120120

r2-testapp/src/main/java/org/readium/r2/testapp/outline/HighlightsFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class HighlightAdapter(private val publication: Publication,
111111

112112
highlightOverflow.setOnClickListener {
113113

114-
val popupMenu = PopupMenu(highlightOverflow.context, highlightChapter)
114+
val popupMenu = PopupMenu(highlightOverflow.context, highlightOverflow)
115115
popupMenu.menuInflater.inflate(R.menu.menu_bookmark, popupMenu.menu)
116116
popupMenu.show()
117117

r2-testapp/src/main/java/org/readium/r2/testapp/tts/ScreenReaderFragment.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ import android.content.SharedPreferences
1010
import android.os.Bundle
1111
import android.util.TypedValue
1212
import android.view.View
13-
import android.widget.Button
1413
import android.widget.ImageButton
1514
import android.widget.TextView
1615
import android.widget.Toast
1716
import androidx.core.widget.TextViewCompat
1817
import androidx.fragment.app.Fragment
1918
import androidx.fragment.app.setFragmentResult
2019
import androidx.lifecycle.ViewModelProvider
21-
import org.readium.r2.testapp.R
2220
import org.readium.r2.shared.publication.Publication
2321
import org.readium.r2.shared.publication.indexOfFirstWithHref
22+
import org.readium.r2.testapp.R
2423
import org.readium.r2.testapp.epub.EpubActivity
2524
import org.readium.r2.testapp.reader.ReaderViewModel
2625

@@ -95,9 +94,9 @@ class ScreenReaderFragment : Fragment(R.layout.fragment_screen_reader), ScreenRe
9594

9695
override fun onPlayStateChanged(playing: Boolean) {
9796
if (playing) {
98-
view?.findViewById<ImageButton>(R.id.play_pause)?.setImageResource(android.R.drawable.ic_media_pause)
97+
view?.findViewById<ImageButton>(R.id.play_pause)?.setImageResource(R.drawable.ic_baseline_pause_24)
9998
} else {
100-
view?.findViewById<ImageButton>(R.id.play_pause)?.setImageResource(android.R.drawable.ic_media_play)
99+
view?.findViewById<ImageButton>(R.id.play_pause)?.setImageResource(R.drawable.ic_baseline_play_arrow_24)
101100
}
102101
}
103102

-383 Bytes
Binary file not shown.
-386 Bytes
Binary file not shown.
-1015 Bytes
Binary file not shown.
-1 KB
Binary file not shown.
-822 Bytes
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24"
6+
android:tint="?attr/colorControlNormal">
7+
<path
8+
android:fillColor="@android:color/white"
9+
android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z"/>
10+
</vector>

0 commit comments

Comments
 (0)