From a73769f6014804dbbf501abb1a9481e70950cfcf Mon Sep 17 00:00:00 2001 From: zt515 Date: Fri, 11 Aug 2017 21:25:15 +0800 Subject: [PATCH] UI: About Activity --- app/build.gradle | 10 +- app/src/main/AndroidManifest.xml | 6 + .../completion/widget/CandidatePopupWindow.kt | 6 +- .../frontend/floating/WindowTermView.kt | 2 +- .../java/io/neoterm/ui/about/AboutActivity.kt | 87 ++++++ .../java/io/neoterm/ui/crash/CrashActivity.kt | 8 +- .../neoterm/ui/customize/CustomizeActivity.kt | 12 +- .../neoterm/ui/pm/PackageManagerActivity.kt | 6 +- .../adapter/viewholder/PackageViewHolder.kt | 4 +- .../io/neoterm/ui/settings/SettingActivity.kt | 35 --- .../java/io/neoterm/ui/setup/SetupActivity.kt | 6 +- .../io/neoterm/ui/term/NeoTermActivity.kt | 5 +- .../neoterm/ui/term/NeoTermRemoteInterface.kt | 11 +- .../java/io/neoterm/utils/FullScreenHelper.kt | 2 +- .../neoterm/view/eks/button/IExtraButton.kt | 2 +- app/src/main/res/drawable/ic_description.xml | 9 + app/src/main/res/drawable/ic_donate.xml | 9 + app/src/main/res/drawable/ic_github.xml | 9 + app/src/main/res/drawable/ic_info.xml | 10 + app/src/main/res/drawable/ic_person.xml | 9 + .../drawable/ic_terminal_running_white.xml | 33 --- app/src/main/res/layout/ui_about.xml | 260 ++++++++++++++++++ app/src/main/res/layout/ui_crash.xml | 2 +- app/src/main/res/layout/ui_setup.xml | 5 +- app/src/main/res/values-zh-rCN/strings.xml | 9 +- app/src/main/res/values-zh-rTW/strings.xml | 9 +- app/src/main/res/values/colors.xml | 20 +- app/src/main/res/values/dimens.xml | 1 + app/src/main/res/values/strings.xml | 9 +- app/src/main/res/xml/settings_main.xml | 7 +- chrome-tabs/build.gradle | 8 +- 31 files changed, 474 insertions(+), 137 deletions(-) create mode 100644 app/src/main/java/io/neoterm/ui/about/AboutActivity.kt create mode 100644 app/src/main/res/drawable/ic_description.xml create mode 100644 app/src/main/res/drawable/ic_donate.xml create mode 100644 app/src/main/res/drawable/ic_github.xml create mode 100644 app/src/main/res/drawable/ic_info.xml create mode 100644 app/src/main/res/drawable/ic_person.xml delete mode 100755 app/src/main/res/drawable/ic_terminal_running_white.xml create mode 100644 app/src/main/res/layout/ui_about.xml diff --git a/app/build.gradle b/app/build.gradle index 97935b4..dbb2822 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 25 + compileSdkVersion 26 buildToolsVersion "25.0.2" defaultConfig { applicationId "io.neoterm" minSdkVersion 21 - targetSdkVersion 25 + targetSdkVersion 26 versionCode 22 versionName "1.2.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -49,13 +49,15 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'org.greenrobot:eventbus:3.0.0' - implementation project(':chrome-tabs') - implementation 'com.android.support:design:25.3.1' + implementation 'com.android.support:design:26.0.0' + implementation 'com.android.support:cardview-v7:26.0.0' compile 'com.github.wrdlbrnft:modular-adapter:0.2.0.6' compile 'com.github.wrdlbrnft:sorted-list-adapter:0.2.0.19' compile 'com.simplecityapps:recyclerview-fastscroll:1.0.16' + compile('de.psdev.licensesdialog:licensesdialog:1.8.3') // compile 'com.ramotion.cardslider:card-slider:0.1.0' // compile 'com.github.igalata:Bubble-Picker:v0.2.4' + implementation project(':chrome-tabs') implementation project(path: ':NeoLang') androidTestImplementation project(path: ':NeoLang') } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cec8524..5506df6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -91,6 +91,12 @@ + + (R.id.popup_complete_candidate_list) candidateAdapter = CandidateAdapter(this) listView.adapter = candidateAdapter listView.setOnItemClickListener({ _, _, position, _ -> @@ -131,8 +131,8 @@ class CandidatePopupWindow(val context: Context) { } class CandidateViewHolder(rootView: View) { - val display: TextView = rootView.findViewById(R.id.complete_display) as TextView - val description: TextView = rootView.findViewById(R.id.complete_description) as TextView + val display: TextView = rootView.findViewById(R.id.complete_display) + val description: TextView = rootView.findViewById(R.id.complete_description) val splitView: View = rootView.findViewById(R.id.complete_split) init { diff --git a/app/src/main/java/io/neoterm/frontend/floating/WindowTermView.kt b/app/src/main/java/io/neoterm/frontend/floating/WindowTermView.kt index 6e3fc9e..c0c6e93 100644 --- a/app/src/main/java/io/neoterm/frontend/floating/WindowTermView.kt +++ b/app/src/main/java/io/neoterm/frontend/floating/WindowTermView.kt @@ -18,7 +18,7 @@ class WindowTermView(val context: Context) { @SuppressLint("InflateParams") var rootView: View = LayoutInflater.from(context).inflate(R.layout.ui_term_dialog, null, false) private set - var terminalView: TerminalView = rootView.findViewById(R.id.terminal_view_dialog) as TerminalView + var terminalView: TerminalView = rootView.findViewById(R.id.terminal_view_dialog) private set init { diff --git a/app/src/main/java/io/neoterm/ui/about/AboutActivity.kt b/app/src/main/java/io/neoterm/ui/about/AboutActivity.kt new file mode 100644 index 0000000..c59e739 --- /dev/null +++ b/app/src/main/java/io/neoterm/ui/about/AboutActivity.kt @@ -0,0 +1,87 @@ +package io.neoterm.ui.about + +import android.content.Intent +import android.content.pm.PackageManager +import android.net.Uri +import android.os.Bundle +import android.support.v7.app.AlertDialog +import android.support.v7.app.AppCompatActivity +import android.support.v7.widget.Toolbar +import android.text.Html +import android.view.MenuItem +import android.view.View +import android.widget.TextView +import android.widget.Toast +import de.psdev.licensesdialog.LicensesDialog +import de.psdev.licensesdialog.licenses.ApacheSoftwareLicense20 +import de.psdev.licensesdialog.licenses.GnuGeneralPublicLicense30 +import de.psdev.licensesdialog.licenses.MITLicense +import de.psdev.licensesdialog.model.Notice +import de.psdev.licensesdialog.model.Notices +import io.neoterm.R + + +/** + * @author kiva + */ +class AboutActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.ui_about) + setSupportActionBar(findViewById(R.id.about_toolbar)) + supportActionBar?.setDisplayHomeAsUpEnabled(true) + + try { + val version = packageManager.getPackageInfo(packageName, 0).versionName + (findViewById(R.id.app_version)).text = version + } catch (ignored: PackageManager.NameNotFoundException) { + } + + findViewById(R.id.developersView).setOnClickListener { + AlertDialog.Builder(this) + .setTitle(R.string.about_developers_label) + .setMessage(Html.fromHtml(getString(R.string.about_developers))) + .show() + } + + findViewById(R.id.licensesView).setOnClickListener { + val notices = Notices() + notices.addNotice(Notice("ADBToolkitInstaller", "https://github.com/Crixec/ADBToolKitsInstaller", "Copyright 2017 Crixec", GnuGeneralPublicLicense30())) + notices.addNotice(Notice("Android-Terminal-Emulator", "https://github.com/jackpal/Android-Terminal-Emulator", "Copyright (C) 2011-2016 Steven Luo", ApacheSoftwareLicense20())) + notices.addNotice(Notice("ChromeLikeTabSwitcher", "https://github.com/michael-rapp/ChromeLikeTabSwitcher", "Copyright 2016 - 2017 Michael Rapp", ApacheSoftwareLicense20())) + notices.addNotice(Notice("EventBus", "http://greenrobot.org", "Copyright (C) 2012-2016 Markus Junginger, greenrobot (http://greenrobot.org)", ApacheSoftwareLicense20())) + notices.addNotice(Notice("LicenseDialog", "http://psdev.de/LicensesDialog", "Copyright 2013-2017 Philip Schiffer", ApacheSoftwareLicense20())) + notices.addNotice(Notice("ModularAdapter", "https://wrdlbrnft.github.io/ModularAdapter", "Copyright 2017 Wrdlbrnft", MITLicense())) + notices.addNotice(Notice("RecyclerView-FastScroll", "Copyright (c) 2016, Tim Malseed", "Copyright (c) 2016, Tim Malseed", ApacheSoftwareLicense20())) + notices.addNotice(Notice("SortedListAdapter", "https://wrdlbrnft.github.io/SortedListAdapter/", "Copyright 2017 Wrdlbrnft", MITLicense())) + notices.addNotice(Notice("Termux", "https://termux.com", "Copyright 2016-2017 Fredrik Fornwall", GnuGeneralPublicLicense30())) + LicensesDialog.Builder(this) + .setNotices(notices) + .setIncludeOwnLicense(true) + .build() + .show() + } + + findViewById(R.id.sourceCodeView).setOnClickListener { + openUrl("https://github.com/NeoTerm/NeoTerm") + } + + findViewById(R.id.donateView).setOnClickListener { + Toast.makeText(this, "我知道没人会捐赠的,所以这部分没写", Toast.LENGTH_LONG).show() + } + } + + private fun openUrl(url: String) { + val intent = Intent(Intent.ACTION_VIEW) + intent.data = Uri.parse(url) + startActivity(intent) + } + + override fun onOptionsItemSelected(item: MenuItem?): Boolean { + when (item?.itemId) { + android.R.id.home -> + finish() + } + return super.onOptionsItemSelected(item) + } +} \ No newline at end of file diff --git a/app/src/main/java/io/neoterm/ui/crash/CrashActivity.kt b/app/src/main/java/io/neoterm/ui/crash/CrashActivity.kt index 1f47199..3a5d39a 100644 --- a/app/src/main/java/io/neoterm/ui/crash/CrashActivity.kt +++ b/app/src/main/java/io/neoterm/ui/crash/CrashActivity.kt @@ -16,11 +16,11 @@ class CrashActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.ui_crash) - setSupportActionBar(findViewById(R.id.crash_toolbar) as Toolbar) + setSupportActionBar(findViewById(R.id.crash_toolbar)) - (findViewById(R.id.crash_model) as TextView).text = getString(R.string.crash_model, collectModelInfo()) - (findViewById(R.id.crash_app_version) as TextView).text = getString(R.string.crash_app, collectAppInfo()) - (findViewById(R.id.crash_details) as TextView).text = collectExceptionInfo() + (findViewById(R.id.crash_model)).text = getString(R.string.crash_model, collectModelInfo()) + (findViewById(R.id.crash_app_version)).text = getString(R.string.crash_app, collectAppInfo()) + (findViewById(R.id.crash_details)).text = collectExceptionInfo() } private fun collectExceptionInfo(): String { diff --git a/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt b/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt index 3fc3cfc..6765a56 100644 --- a/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt +++ b/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt @@ -42,12 +42,12 @@ class CustomizeActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.ui_customize) - val toolbar = findViewById(R.id.custom_toolbar) as Toolbar + val toolbar = findViewById(R.id.custom_toolbar) setSupportActionBar(toolbar) supportActionBar?.setDisplayHomeAsUpEnabled(true) - terminalView = findViewById(R.id.terminal_view) as TerminalView - extraKeysView = findViewById(R.id.custom_extra_keys) as ExtraKeysView + terminalView = findViewById(R.id.terminal_view) + extraKeysView = findViewById(R.id.custom_extra_keys) viewClient = BasicViewClient(terminalView) sessionCallback = BasicSessionCallback(terminalView) TerminalUtils.setupTerminalView(terminalView, viewClient) @@ -61,14 +61,14 @@ class CustomizeActivity : AppCompatActivity() { session = TerminalUtils.createShellSession(this, parameter) terminalView.attachSession(session) - findViewById(R.id.custom_install_font_button).setOnClickListener { + findViewById(R.id.custom_install_font_button).setOnClickListener { val intent = Intent() intent.action = Intent.ACTION_GET_CONTENT intent.type = "*/*" startActivityForResult(Intent.createChooser(intent, getString(R.string.install_font)), REQUEST_SELECT_FONT) } - findViewById(R.id.custom_install_color_button).setOnClickListener { + findViewById(R.id.custom_install_color_button).setOnClickListener { val intent = Intent() intent.action = Intent.ACTION_GET_CONTENT intent.type = "*/*" @@ -109,7 +109,7 @@ class CustomizeActivity : AppCompatActivity() { } private fun setupSpinner(id: Int, data: List, selected: String, listener: AdapterView.OnItemSelectedListener) { - val spinner = findViewById(id) as Spinner + val spinner = findViewById(id) val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, data) adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) spinner.adapter = adapter diff --git a/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt b/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt index eed062a..ad44793 100644 --- a/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt +++ b/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt @@ -54,12 +54,12 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.ui_package_manager) - val toolbar = findViewById(R.id.pm_toolbar) as Toolbar + val toolbar = findViewById(R.id.pm_toolbar) setSupportActionBar(toolbar) supportActionBar?.setDisplayHomeAsUpEnabled(true) - progressBar = findViewById(R.id.package_loading_progress_bar) as ProgressBar - recyclerView = findViewById(R.id.package_list) as RecyclerView + progressBar = findViewById(R.id.package_loading_progress_bar) + recyclerView = findViewById(R.id.package_list) recyclerView.setHasFixedSize(true) adapter = PackageAdapter(this, COMPARATOR, object : PackageAdapter.Listener { override fun onModelClicked(model: PackageModel) { diff --git a/app/src/main/java/io/neoterm/ui/pm/adapter/viewholder/PackageViewHolder.kt b/app/src/main/java/io/neoterm/ui/pm/adapter/viewholder/PackageViewHolder.kt index 107ef64..dc65968 100755 --- a/app/src/main/java/io/neoterm/ui/pm/adapter/viewholder/PackageViewHolder.kt +++ b/app/src/main/java/io/neoterm/ui/pm/adapter/viewholder/PackageViewHolder.kt @@ -10,8 +10,8 @@ import io.neoterm.ui.pm.adapter.PackageAdapter import io.neoterm.ui.pm.model.PackageModel class PackageViewHolder(private val rootView: View, private val listener: PackageAdapter.Listener) : SortedListAdapter.ViewHolder(rootView) { - private val packageNameView: TextView = rootView.findViewById(R.id.package_item_name) as TextView - private val packageDescView: TextView = rootView.findViewById(R.id.package_item_desc) as TextView + private val packageNameView: TextView = rootView.findViewById(R.id.package_item_name) + private val packageDescView: TextView = rootView.findViewById(R.id.package_item_desc) override fun performBind(item: PackageModel) { rootView.setOnClickListener { listener.onModelClicked(item) } diff --git a/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt b/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt index c2ace81..f3d36f2 100644 --- a/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt +++ b/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt @@ -1,7 +1,6 @@ package io.neoterm.ui.settings import android.os.Bundle -import android.support.v7.app.AlertDialog import android.support.v7.app.AppCompatPreferenceActivity import android.view.MenuItem import io.neoterm.R @@ -16,40 +15,6 @@ class SettingActivity : AppCompatPreferenceActivity() { supportActionBar.title = getString(R.string.settings) supportActionBar.setDisplayHomeAsUpEnabled(true) addPreferencesFromResource(R.xml.settings_main) - findPreference(getString(R.string.about)).setOnPreferenceClickListener { - AlertDialog.Builder(this@SettingActivity) - .setTitle("为什么我们选择开发NeoTerm?") - .setMessage("安卓上的终端,一直以来就有这样的诟病:" + - "只能用安卓自带的程序,要想用用户体验更好的终端程序," + - "你需要额外配置一堆烦琐的环境," + - "甚至需要自己动手编译符合安卓设备的版本。" + - "就在这时,Termux出现了," + - "很完美,一行命令就能安装一个原来想都不敢想的软件," + - "比如MySQL, clang。\n" + - "但用着用着,感觉这样的终端还差点什么," + - "仅仅有丰富的软件包是不够的," + - "Termux在部分功能上可以说是欠妥甚至缺乏," + - "再者安卓并非自带键盘," + - "在小小的屏幕上触摸虚拟键盘来跟命令行打交道实属残忍," + - "但我们又没法强迫所有用户在使用终端的时候再额外接一个键盘," + - "我们只能从终端的层面来解决问题," + - "于是我们开发了这款app," + - "并取名Neo Term(Neo正是new的意思)," + - "并希望它可以改善用户在终端下的体验," + - "让软件包与终端功能两不误。" + - "不可否认,开发过程中Termux给了我们很大帮助," + - "不仅提供了很好的terminal-view," + - "还提供了庞大的软件包仓库," + - "这一点我们对原作者表示忠诚的感谢。" + - "日后的开发中,我们会紧跟用户反馈," + - "努力打造安卓上最好用的终端。\n" + - "\n" + - "NeoTerm 开发者们\n" + - "2017.6.19 00:16") - .setPositiveButton(android.R.string.yes, null) - .show() - return@setOnPreferenceClickListener true - } } override fun onBuildHeaders(target: MutableList
?) { diff --git a/app/src/main/java/io/neoterm/ui/setup/SetupActivity.kt b/app/src/main/java/io/neoterm/ui/setup/SetupActivity.kt index 12f3941..786ae37 100644 --- a/app/src/main/java/io/neoterm/ui/setup/SetupActivity.kt +++ b/app/src/main/java/io/neoterm/ui/setup/SetupActivity.kt @@ -16,16 +16,11 @@ import io.neoterm.utils.PackageUtils * @author kiva */ class SetupActivity : AppCompatActivity() { - lateinit var toast: Toast var aptUpdated = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.ui_setup) - val nextButton = findViewById(R.id.setup_next) as Button - nextButton.setOnClickListener { - finish() - } installBaseFiles() } @@ -73,6 +68,7 @@ class SetupActivity : AppCompatActivity() { PackageUtils.executeApt(this, "upgrade", arrayOf("-y"), { exitStatus, dialog -> if (exitStatus == 0) { dialog.dismiss() + finish() } else { dialog.setTitle(getString(R.string.error)) } diff --git a/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt b/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt index b8a0b94..1cfe1c0 100644 --- a/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt +++ b/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt @@ -72,7 +72,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference setContentView(R.layout.ui_main) - toolbar = findViewById(R.id.terminal_toolbar) as Toolbar + toolbar = findViewById(R.id.terminal_toolbar) setSupportActionBar(toolbar) fullScreenHelper = FullScreenHelper.injectActivity(this, fullscreen, peekRecreating()) @@ -86,7 +86,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference } }) - tabSwitcher = findViewById(R.id.tab_switcher) as TabSwitcher + tabSwitcher = findViewById(R.id.tab_switcher) tabSwitcher.decorator = TermTabDecorator(this) ViewCompat.setOnApplyWindowInsetsListener(tabSwitcher, createWindowInsetsListener()) tabSwitcher.showToolbars(false) @@ -334,6 +334,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference // When rotate the screen, extra keys may get updated. forEachTab { it.resetStatus() } +// tabSwitcher } private fun floatTabUp(tab: TermTab) { diff --git a/app/src/main/java/io/neoterm/ui/term/NeoTermRemoteInterface.kt b/app/src/main/java/io/neoterm/ui/term/NeoTermRemoteInterface.kt index ebc0e79..cbd3f68 100644 --- a/app/src/main/java/io/neoterm/ui/term/NeoTermRemoteInterface.kt +++ b/app/src/main/java/io/neoterm/ui/term/NeoTermRemoteInterface.kt @@ -24,6 +24,7 @@ import io.neoterm.utils.TerminalUtils import java.io.File import android.content.Intent.ShortcutIconResource import android.util.Log +import android.view.View import io.neoterm.App import io.neoterm.frontend.logging.NLog import io.neoterm.frontend.service.ServiceManager @@ -94,9 +95,9 @@ class NeoTermRemoteInterface : AppCompatActivity(), ServiceConnection { private fun handleCommandShortcut() { setContentView(R.layout.ui_command_shortcut) - val displayInput = findViewById(R.id.command_shortcut_display_title) as EditText - val commandInput = findViewById(R.id.command_shortcut_command) as EditText - findViewById(R.id.command_shortcut_create_fab) + val displayInput = findViewById(R.id.command_shortcut_display_title) + val commandInput = findViewById(R.id.command_shortcut_command) + findViewById(R.id.command_shortcut_create_fab) .setOnClickListener { val displayTitle = displayInput.text.toString() if (displayTitle.isEmpty()) { @@ -172,7 +173,7 @@ class NeoTermRemoteInterface : AppCompatActivity(), ServiceConnection { private fun setupUserScriptView(filesToHandle: MutableList, userScripts: List) { setContentView(R.layout.ui_user_script_list) - val filesList = findViewById(R.id.user_script_file_list) as ListView + val filesList = findViewById(R.id.user_script_file_list) val filesAdapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, filesToHandle) filesList.adapter = filesAdapter filesList.setOnItemClickListener { _, _, position, _ -> @@ -186,7 +187,7 @@ class NeoTermRemoteInterface : AppCompatActivity(), ServiceConnection { .show() } - val scriptsList = findViewById(R.id.user_script_script_list) as ListView + val scriptsList = findViewById(R.id.user_script_script_list) val scriptsListItem = mutableListOf() userScripts.mapTo(scriptsListItem, { it.scriptFile.nameWithoutExtension }) diff --git a/app/src/main/java/io/neoterm/utils/FullScreenHelper.kt b/app/src/main/java/io/neoterm/utils/FullScreenHelper.kt index e59a6be..734b4c2 100644 --- a/app/src/main/java/io/neoterm/utils/FullScreenHelper.kt +++ b/app/src/main/java/io/neoterm/utils/FullScreenHelper.kt @@ -36,7 +36,7 @@ class FullScreenHelper private constructor(activity: Activity, var fullScreen: B } init { - val content = activity.findViewById(android.R.id.content) as FrameLayout + val content = activity.findViewById(android.R.id.content) mChildOfContent = content.getChildAt(0) mChildOfContent.viewTreeObserver.addOnGlobalLayoutListener { if (this@FullScreenHelper.fullScreen) { diff --git a/app/src/main/java/io/neoterm/view/eks/button/IExtraButton.kt b/app/src/main/java/io/neoterm/view/eks/button/IExtraButton.kt index 0c5a362..8f7c81d 100644 --- a/app/src/main/java/io/neoterm/view/eks/button/IExtraButton.kt +++ b/app/src/main/java/io/neoterm/view/eks/button/IExtraButton.kt @@ -67,7 +67,7 @@ abstract class IExtraButton : View.OnClickListener { view.dispatchKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, keyCode)) view.dispatchKeyEvent(KeyEvent(KeyEvent.ACTION_UP, keyCode)) } else { - val terminalView = view.findViewById(R.id.terminal_view) as TerminalView + val terminalView = view.findViewById(R.id.terminal_view) val session = terminalView.currentSession session?.write(chars) } diff --git a/app/src/main/res/drawable/ic_description.xml b/app/src/main/res/drawable/ic_description.xml new file mode 100644 index 0000000..e46258a --- /dev/null +++ b/app/src/main/res/drawable/ic_description.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_donate.xml b/app/src/main/res/drawable/ic_donate.xml new file mode 100644 index 0000000..8fb8574 --- /dev/null +++ b/app/src/main/res/drawable/ic_donate.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_github.xml b/app/src/main/res/drawable/ic_github.xml new file mode 100644 index 0000000..39a650c --- /dev/null +++ b/app/src/main/res/drawable/ic_github.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_info.xml b/app/src/main/res/drawable/ic_info.xml new file mode 100644 index 0000000..9b3a020 --- /dev/null +++ b/app/src/main/res/drawable/ic_info.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_person.xml b/app/src/main/res/drawable/ic_person.xml new file mode 100644 index 0000000..1534a90 --- /dev/null +++ b/app/src/main/res/drawable/ic_person.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_terminal_running_white.xml b/app/src/main/res/drawable/ic_terminal_running_white.xml deleted file mode 100755 index 815e87f..0000000 --- a/app/src/main/res/drawable/ic_terminal_running_white.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/layout/ui_about.xml b/app/src/main/res/layout/ui_about.xml new file mode 100644 index 0000000..8fa2dc1 --- /dev/null +++ b/app/src/main/res/layout/ui_about.xml @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/ui_crash.xml b/app/src/main/res/layout/ui_crash.xml index ce8da0e..140a8f6 100644 --- a/app/src/main/res/layout/ui_crash.xml +++ b/app/src/main/res/layout/ui_crash.xml @@ -10,7 +10,7 @@ android:id="@+id/crash_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="@color/colorPrimaryDark" + android:background="@color/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark" app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" /> diff --git a/app/src/main/res/layout/ui_setup.xml b/app/src/main/res/layout/ui_setup.xml index 15551f5..d761aae 100644 --- a/app/src/main/res/layout/ui_setup.xml +++ b/app/src/main/res/layout/ui_setup.xml @@ -27,10 +27,9 @@ android:textColor="@color/colorAccent" android:textSize="16sp" /> -