UI: About Activity

This commit is contained in:
zt515 2017-08-11 21:25:15 +08:00
parent 05712493b3
commit a73769f601
31 changed files with 474 additions and 137 deletions

View File

@ -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')
}

View File

@ -91,6 +91,12 @@
</intent-filter>
</activity-alias>
<activity
android:name=".ui.about.AboutActivity"
android:exported="false"
android:label="@string/about"
android:theme="@style/AppTheme.NoActionBar.Dark" />
<activity
android:name=".ui.crash.CrashActivity"
android:exported="false"

View File

@ -65,7 +65,7 @@ class CandidatePopupWindow(val context: Context) {
popupWindow.isOutsideTouchable = true
popupWindow.isTouchable = true
val contentView = LayoutInflater.from(context).inflate(R.layout.popup_auto_complete, null, false)
val listView = contentView.findViewById(R.id.popup_complete_candidate_list) as ListView
val listView = contentView.findViewById<ListView>(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<TextView>(R.id.complete_display)
val description: TextView = rootView.findViewById<TextView>(R.id.complete_description)
val splitView: View = rootView.findViewById(R.id.complete_split)
init {

View File

@ -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<TerminalView>(R.id.terminal_view_dialog)
private set
init {

View File

@ -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<Toolbar>(R.id.about_toolbar))
supportActionBar?.setDisplayHomeAsUpEnabled(true)
try {
val version = packageManager.getPackageInfo(packageName, 0).versionName
(findViewById<TextView>(R.id.app_version)).text = version
} catch (ignored: PackageManager.NameNotFoundException) {
}
findViewById<View>(R.id.developersView).setOnClickListener {
AlertDialog.Builder(this)
.setTitle(R.string.about_developers_label)
.setMessage(Html.fromHtml(getString(R.string.about_developers)))
.show()
}
findViewById<View>(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<View>(R.id.sourceCodeView).setOnClickListener {
openUrl("https://github.com/NeoTerm/NeoTerm")
}
findViewById<View>(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)
}
}

View File

@ -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<Toolbar>(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<TextView>(R.id.crash_model)).text = getString(R.string.crash_model, collectModelInfo())
(findViewById<TextView>(R.id.crash_app_version)).text = getString(R.string.crash_app, collectAppInfo())
(findViewById<TextView>(R.id.crash_details)).text = collectExceptionInfo()
}
private fun collectExceptionInfo(): String {

View File

@ -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<Toolbar>(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<TerminalView>(R.id.terminal_view)
extraKeysView = findViewById<ExtraKeysView>(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<View>(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<View>(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<String>, selected: String, listener: AdapterView.OnItemSelectedListener) {
val spinner = findViewById(id) as Spinner
val spinner = findViewById<Spinner>(id)
val adapter = ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, data)
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
spinner.adapter = adapter

View File

@ -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<Toolbar>(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<ProgressBar>(R.id.package_loading_progress_bar)
recyclerView = findViewById<RecyclerView>(R.id.package_list)
recyclerView.setHasFixedSize(true)
adapter = PackageAdapter(this, COMPARATOR, object : PackageAdapter.Listener {
override fun onModelClicked(model: PackageModel) {

View File

@ -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<PackageModel>(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<TextView>(R.id.package_item_name)
private val packageDescView: TextView = rootView.findViewById<TextView>(R.id.package_item_desc)
override fun performBind(item: PackageModel) {
rootView.setOnClickListener { listener.onModelClicked(item) }

View File

@ -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<Header>?) {

View File

@ -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))
}

View File

@ -72,7 +72,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
setContentView(R.layout.ui_main)
toolbar = findViewById(R.id.terminal_toolbar) as Toolbar
toolbar = findViewById<Toolbar>(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<TabSwitcher>(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) {

View File

@ -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<EditText>(R.id.command_shortcut_display_title)
val commandInput = findViewById<EditText>(R.id.command_shortcut_command)
findViewById<View>(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<String>, userScripts: List<UserScript>) {
setContentView(R.layout.ui_user_script_list)
val filesList = findViewById(R.id.user_script_file_list) as ListView
val filesList = findViewById<ListView>(R.id.user_script_file_list)
val filesAdapter = ArrayAdapter<String>(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<ListView>(R.id.user_script_script_list)
val scriptsListItem = mutableListOf<String>()
userScripts.mapTo(scriptsListItem, { it.scriptFile.nameWithoutExtension })

View File

@ -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<FrameLayout>(android.R.id.content)
mChildOfContent = content.getChildAt(0)
mChildOfContent.viewTreeObserver.addOnGlobalLayoutListener {
if (this@FullScreenHelper.fullScreen) {

View File

@ -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<TerminalView>(R.id.terminal_view)
val session = terminalView.currentSession
session?.write(chars)
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#757575"
android:pathData="M14,2L6,2c-1.1,0 -1.99,0.9 -1.99,2L4,20c0,1.1 0.89,2 1.99,2L18,22c1.1,0 2,-0.9 2,-2L20,8l-6,-6zM16,18L8,18v-2h8v2zM16,14L8,14v-2h8v2zM13,9L13,3.5L18.5,9L13,9z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#757575"
android:pathData="M11.8,10.9c-2.27,-0.59 -3,-1.2 -3,-2.15 0,-1.09 1.01,-1.85 2.7,-1.85 1.78,0 2.44,0.85 2.5,2.1h2.21c-0.07,-1.72 -1.12,-3.3 -3.21,-3.81V3h-3v2.16c-1.94,0.42 -3.5,1.68 -3.5,3.61 0,2.31 1.91,3.46 4.7,4.13 2.5,0.6 3,1.48 3,2.41 0,0.69 -0.49,1.79 -2.7,1.79 -2.06,0 -2.87,-0.92 -2.98,-2.1h-2.2c0.12,2.19 1.76,3.42 3.68,3.83V21h3v-2.15c1.95,-0.37 3.5,-1.5 3.5,-3.55 0,-2.84 -2.43,-3.81 -4.7,-4.4z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dip"
android:height="24.0dip"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#757575"
android:pathData="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" />
</vector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#757575"
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#757575"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

View File

@ -1,33 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="48dp"
android:width="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<!--
https://material.google.com/style/icons.html
-->
<!-- Screen border. -->
<path android:fillColor="#fafafa"
android:strokeColor="#212121"
android:strokeWidth="3"
android:pathData="M7,4
l34,0
q3 0,3 3
l0,34
q0 3, -3 3
l-34,0
q-3 0, -3-3
l0 -34
q0 -3, 3 -3"
/>
<!-- BlcursorColorrsor. -->
<path android:fillColor="#000"
android:pathData="M14,14
l5,0
l0,10
l-5,0"
/>
</vector>

View File

@ -0,0 +1,260 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables,ContentDescription">
<android.support.v7.widget.Toolbar
android:id="@+id/about_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<LinearLayout
android:id="@android:id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="8dp"
app:cardBackgroundColor="@color/list_download_item_color_dark"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="72dp"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center_vertical"
android:src="@mipmap/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="48dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_info" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:layout_marginStart="32dp"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_version_label"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
<TextView
android:id="@+id/app_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/developersView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="48dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_person" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:layout_marginStart="32dp"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_developers_label"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/licensesView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="@dimen/md_list_item_height"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_description" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:layout_marginStart="32dp"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="@string/about_libraries_label"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</LinearLayout>
<LinearLayout
android:id="@+id/sourceCodeView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="48dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_github" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:layout_marginStart="32dp"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_source_label"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/donateView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="48dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_donate" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:layout_marginStart="32dp"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/support_donate_label"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/support_donate_description"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -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" />

View File

@ -27,10 +27,9 @@
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<Button
<TextView
android:id="@+id/setup_next"
android:layout_gravity="end"
style="?buttonBarButtonStyle"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/preview_layout_margin"

View File

@ -76,7 +76,7 @@
<string name="setup_hello">发现</string>
<string name="setup_info">你好NeoTerm</string>
<string name="setup_info2">轻触以选择你的最爱</string>
<string name="setup_next">安装</string>
<string name="setup_next">短暂的安装过程之后,\n即可开始使用NeoTerm</string>
<string name="discovery">发现</string>
<string name="crash_model">设备: %s</string>
<string name="crash_app">应用: %s</string>
@ -110,4 +110,11 @@
<string name="restore_session">取消</string>
<string name="show_help">查看帮助</string>
<string name="service_connection_failed">无法连接到服务</string>
<string name="about_version_label">版本</string>
<string name="about_developers_label">主要开发者</string>
<string name="about_libraries_label">第三方库</string>
<string name="about_source_label">源码</string>
<string name="support_donate_label">捐赠</string>
<string name="support_donate_description">如果你喜欢这个app你可以考虑请作者喝杯咖啡</string>
<string name="about_developers"><a href="https://github.com/zt515">Kiva</a> 维护<br/><a href="https://github.com/Crixec">Crixec</a> 图标设计</string>
</resources>

View File

@ -76,7 +76,7 @@
<string name="setup_hello">發現</string>
<string name="setup_info">你好NeoTerm</string>
<string name="setup_info2">輕觸以選擇你的最愛</string>
<string name="setup_next">安裝</string>
<string name="setup_next">短暫的安裝過程之後,\n即可開始使用NeoTerm</string>
<string name="discovery">發現</string>
<string name="crash_model">裝置: %s</string>
<string name="crash_app">程式: %s</string>
@ -110,4 +110,11 @@
<string name="restore_session">取消</string>
<string name="show_help">查看幫助</string>
<string name="service_connection_failed">無法連接到服務</string>
<string name="about_version_label">版本</string>
<string name="about_developers_label">主要開發者</string>
<string name="about_libraries_label">協力廠商庫</string>
<string name="about_source_label">源碼</string>
<string name="support_donate_label">捐贈</string>
<string name="support_donate_description">如果你喜歡這個app你可以考慮請作者喝杯咖啡</string>
<string name="about_developers"><a href="https://github.com/zt515">Kiva</a> 維護<br/><a href="https://github.com/Crixec">Crixec</a> 圖標設計</string>
</resources>

View File

@ -7,25 +7,7 @@
<color name="textColor">#fefefe</color>
<color name="textColorSecondary">#ced7db</color>
<color name="blueStart">#4EFFF3</color>
<color name="blueEnd">#0ca6f9</color>
<color name="purpleStart">#a369ff</color>
<color name="purpleEnd">#0e56ff</color>
<color name="roseStart">#FF6A00</color>
<color name="roseEnd">#ef0276</color>
<color name="greenStart">#a7f56e</color>
<color name="greenEnd">#11c612</color>
<color name="popup_background">#7f000000</color>
<color name="popup_split_background">#efefef</color>
<integer-array name="bubble_colors">
<item>@color/roseStart</item>
<item>@color/roseEnd</item>
<item>@color/blueStart</item>
<item>@color/blueEnd</item>
<item>@color/greenStart</item>
<item>@color/greenEnd</item>
<item>@color/purpleStart</item>
<item>@color/purpleEnd</item>
</integer-array>
<color name="list_download_item_color_dark">#363636</color>
</resources>

View File

@ -12,4 +12,5 @@
<dimen name="custom_install_icon_height">36dp</dimen>
<dimen name="min_popup_height">24dp</dimen>
<dimen name="popup_padding">4dp</dimen>
<dimen name="md_list_item_height">48dp</dimen>
</resources>

View File

@ -15,7 +15,7 @@
<string name="setup_hello">Discovery</string>
<string name="setup_info">Hello, NeoTerm</string>
<string name="setup_info2">Tap to choose your favorites</string>
<string name="setup_next">Install</string>
<string name="setup_next">After a short installation process,\nyou can start using NeoTerm</string>
<string name="about">About</string>
<string name="discovery">Discovery</string>
@ -105,6 +105,13 @@
<string name="restore_session">Cancel</string>
<string name="show_help">Show Help</string>
<string name="service_connection_failed">Failed to connect to service</string>
<string name="about_version_label">Version</string>
<string name="about_developers_label">Main Developers</string>
<string name="about_libraries_label">Libraries</string>
<string name="about_source_label">Source Code</string>
<string name="support_donate_label">Donate</string>
<string name="support_donate_description">If you like this app, you can offer developers a cup of coffee</string>
<string name="about_developers"><a href="https://github.com/zt515">Kiva</a> for Maintaining<br/><a href="https://github.com/Crixec">Crixec</a>for Icon Design</string>
<string-array name="pref_general_shell_entries" translatable="false">
<item>sh</item>

View File

@ -50,7 +50,10 @@
<Preference
android:icon="@drawable/ic_info_white_36dp"
android:key="@string/about"
android:title="@string/about" />
android:title="@string/about" >
<intent
android:targetClass="io.neoterm.ui.about.AboutActivity"
android:targetPackage="io.neoterm" />
</Preference>
</PreferenceScreen>

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
@ -19,7 +19,7 @@ android {
dependencies {
compile 'com.github.michael-rapp:android-util:1.15.0'
compile 'com.android.support:support-annotations:25.3.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:support-annotations:26.0.0'
compile 'com.android.support:appcompat-v7:26.0.0'
testCompile 'junit:junit:4.12'
}