2323import java .util .ArrayList ;
2424import java .util .List ;
2525import java .util .Objects ;
26+ import java .util .logging .Logger ;
2627
2728
2829/**
@@ -50,7 +51,7 @@ public class KboardIME extends InputMethodService
5051 private int totalScreens = 0 ;
5152 private int mRows = 5 ;
5253 private int mKeysPerScreen = 12 ;
53- private final int KEYS_PER_ROW = 4 ;
54+ private int mKeysPerRow = 4 ;
5455
5556
5657
@@ -76,9 +77,9 @@ private void initPrefs() {
7677 mSoundOnClick = sharedPref .getBoolean ("sound_on" , false );
7778 mPassiveAggressive = sharedPref .getBoolean ("passive_aggressive" , false );
7879 mRows = Integer .parseInt (Objects .requireNonNull (sharedPref .getString ("rows" , "5" )));
79- mKeysPerScreen = mRows * KEYS_PER_ROW ;
80+ mKeysPerRow = (mRows == 1 ) ? 1 : 4 ;
81+ mKeysPerScreen = mRows * mKeysPerRow ;
8082 setKeys ();
81-
8283 }
8384
8485
@@ -88,7 +89,7 @@ private void setKeys() {
8889 String defaultJson = gson .toJson (Keys .getDefault ());
8990 String keysAsString = sharedPref .getString (Keys .STORAGE_KEY , defaultJson );
9091 keys = gson .fromJson (keysAsString , ArrayList .class );
91- totalScreens = (int )Math .ceil ((double )keys .size () / (mRows * KEYS_PER_ROW ));
92+ totalScreens = (int )Math .ceil ((double )keys .size () / (mRows * mKeysPerRow ));
9293
9394 }
9495 @ Override public void onInitializeInterface () {
0 commit comments