Преглед изворни кода

Change column number of Standard Stamp to depend on dimens.xml

cooperku_kdanmobile пре 5 година
родитељ
комит
a5e7739b90

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/stamp/StampTabView.kt

@@ -113,7 +113,7 @@ class StampTabView : ConstraintLayout {
                 else -> {
                     val standardStampView = layoutInflater.inflate(R.layout.view_media_box_item_stamp_standard, container, false)
                     val recyclerView = standardStampView.recyclerView_shapeStandard
-                    recyclerView.layoutManager = GridLayoutManager(context, 3)
+                    recyclerView.layoutManager = GridLayoutManager(context, resources.getInteger(R.integer.mediaBox_standardStamp_columnCount))
                     val adapter = StandardStampAdapter(context, STANDARD_STAMP_RES.values())
                     adapter.setOnStampClickListener(object : OnStampClickListener {
                         override fun onStampClick(index: Int) {

+ 2 - 0
reader/src/main/res/values-land/dimens.xml

@@ -1,3 +1,5 @@
 <resources>
     <dimen name="reader_media_box_height">0dp</dimen>
+
+    <integer name="mediaBox_standardStamp_columnCount">3</integer>
 </resources>

+ 2 - 0
reader/src/main/res/values/dimens.xml

@@ -9,4 +9,6 @@
     <dimen name="reader_left_right_toolbar_icon_width">48dp</dimen>
 
     <dimen name="reader_media_box_height">336dp</dimen>
+
+    <integer name="mediaBox_standardStamp_columnCount">2</integer>
 </resources>