Skip to content

Commit

Permalink
Fix layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryosuke839 committed Sep 17, 2024
1 parent d999f27 commit e2e4438
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "jp.ddo.hotmist.unicodepad"
minSdkVersion 21
targetSdkVersion 34
versionCode 65
versionName "2.14.2"
versionCode 66
versionName "2.14.3"
}

compileOptions {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/jp/ddo/hotmist/unicodepad/EditAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ internal class EditAdapter(activity: Activity, pref: SharedPreferences, db: Name
return mItemList[i].first.toString()
}

override fun onBindViewHolder(holder: UnicodeAdapter.ViewHolder, position: Int) {
super.onBindViewHolder(holder, position)
if (holder is UnicodeAdapter.CharacterViewHolder) holder.characterView.drawSlash(false)
}

override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
if (suspend) return

Expand Down
15 changes: 8 additions & 7 deletions app/src/main/java/jp/ddo/hotmist/unicodepad/PageAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ class PageAdapter(private val activity: UnicodeActivity, private val pref: Share

private var dlg: AlertDialog? = null
fun showDesc(parentAdapter: UnicodeAdapter?, index: Int, ua: UnicodeAdapter) {
val tab = PagerTabStrip(activity)
tab.id = R.id.TAB_ID
val layoutParams = ViewPager.LayoutParams()
layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT
layoutParams.gravity = Gravity.TOP
val pager = ViewPager(activity)
pager.addView(tab, layoutParams)
pager.addView(PagerTabStrip(activity).apply {
id = R.id.TAB_ID
}, ViewPager.LayoutParams().apply {
height = ViewGroup.LayoutParams.WRAP_CONTENT
width = ViewGroup.LayoutParams.MATCH_PARENT
gravity = Gravity.TOP
isDecor = true
})
val adapter = CharacterAdapter(activity, ua.freeze(), tf, locale, db, adapterFavorite)
pager.adapter = adapter
pager.setCurrentItem(index, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class UnicodeActivity : BaseActivity() {
width = ViewPager.LayoutParams.MATCH_PARENT
height = ViewPager.LayoutParams.WRAP_CONTENT
gravity = Gravity.TOP
isDecor = true
})
}
chooser = FontChooser(this@UnicodeActivity, Spinner(this).apply {
Expand Down

0 comments on commit e2e4438

Please sign in to comment.