|
|
@ -7,9 +7,11 @@ import android.view.View |
|
|
|
import android.view.ViewGroup |
|
|
|
import android.view.ViewGroup |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.BaseDialogFragment |
|
|
|
import io.legado.app.base.BaseDialogFragment |
|
|
|
|
|
|
|
import io.legado.app.constant.EventBus |
|
|
|
import io.legado.app.help.ReadTipConfig |
|
|
|
import io.legado.app.help.ReadTipConfig |
|
|
|
import io.legado.app.lib.dialogs.selector |
|
|
|
import io.legado.app.lib.dialogs.selector |
|
|
|
import io.legado.app.ui.book.read.Help |
|
|
|
import io.legado.app.ui.book.read.Help |
|
|
|
|
|
|
|
import io.legado.app.utils.postEvent |
|
|
|
import kotlinx.android.synthetic.main.dialog_tip_config.* |
|
|
|
import kotlinx.android.synthetic.main.dialog_tip_config.* |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
|
|
|
|
|
|
|
@ -57,36 +59,42 @@ class TipConfigDialog : BaseDialogFragment() { |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
ReadTipConfig.tipHeaderLeft = i |
|
|
|
ReadTipConfig.tipHeaderLeft = i |
|
|
|
tv_header_left.text = ReadTipConfig.tipArray[i] |
|
|
|
tv_header_left.text = ReadTipConfig.tipArray[i] |
|
|
|
|
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_header_middle.onClick { |
|
|
|
tv_header_middle.onClick { |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
ReadTipConfig.tipHeaderMiddle = i |
|
|
|
ReadTipConfig.tipHeaderMiddle = i |
|
|
|
tv_header_middle.text = ReadTipConfig.tipArray[i] |
|
|
|
tv_header_middle.text = ReadTipConfig.tipArray[i] |
|
|
|
|
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_header_right.onClick { |
|
|
|
tv_header_right.onClick { |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
ReadTipConfig.tipHeaderRight = i |
|
|
|
ReadTipConfig.tipHeaderRight = i |
|
|
|
tv_header_right.text = ReadTipConfig.tipArray[i] |
|
|
|
tv_header_right.text = ReadTipConfig.tipArray[i] |
|
|
|
|
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_footer_left.onClick { |
|
|
|
tv_footer_left.onClick { |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
ReadTipConfig.tipFooterLeft = i |
|
|
|
ReadTipConfig.tipFooterLeft = i |
|
|
|
tv_footer_left.text = ReadTipConfig.tipArray[i] |
|
|
|
tv_footer_left.text = ReadTipConfig.tipArray[i] |
|
|
|
|
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_footer_middle.onClick { |
|
|
|
tv_footer_middle.onClick { |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
ReadTipConfig.tipFooterMiddle = i |
|
|
|
ReadTipConfig.tipFooterMiddle = i |
|
|
|
tv_footer_middle.text = ReadTipConfig.tipArray[i] |
|
|
|
tv_footer_middle.text = ReadTipConfig.tipArray[i] |
|
|
|
|
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_footer_right.onClick { |
|
|
|
tv_footer_right.onClick { |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
selector(items = ReadTipConfig.tipArray.toList()) { _, i -> |
|
|
|
ReadTipConfig.tipFooterRight = i |
|
|
|
ReadTipConfig.tipFooterRight = i |
|
|
|
tv_footer_right.text = ReadTipConfig.tipArray[i] |
|
|
|
tv_footer_right.text = ReadTipConfig.tipArray[i] |
|
|
|
|
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|