Refactor: Activity structure
This commit is contained in:
@ -32,6 +32,17 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity-alias
|
||||
android:name=".NeoLotMainActivity"
|
||||
android:targetActivity="io.neoterm.ui.term.NeoTermActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.IOT_LAUNCHER" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
<activity
|
||||
android:name=".ui.term.NeoTermRemoteInterface"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
@ -83,11 +94,10 @@
|
||||
</activity-alias>
|
||||
|
||||
<activity
|
||||
android:name=".ui.about.AboutActivity"
|
||||
android:name=".ui.support.AboutActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/about"
|
||||
android:theme="@style/AppTheme.NoActionBar.Dark" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.crash.CrashActivity"
|
||||
android:exported="false"
|
||||
@ -95,44 +105,47 @@
|
||||
android:theme="@style/AppTheme.NoActionBar.Dark" />
|
||||
<activity
|
||||
android:name=".ui.setup.SetupActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".ui.bonus.BonusActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.NoActionBar.Dark" />
|
||||
<activity
|
||||
android:name=".ui.pm.PackageManagerActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/package_settings"
|
||||
android:theme="@style/AppTheme.NoActionBar.Dark" />
|
||||
<activity
|
||||
android:name=".ui.customize.CustomizeActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/customization_settings"
|
||||
android:theme="@style/AppTheme.NoActionBar.Dark" />
|
||||
<activity
|
||||
android:name=".ui.customize.ColorSchemeActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/pref_customization_color_scheme"
|
||||
android:theme="@style/AppTheme.NoActionBar.Dark" />
|
||||
<activity
|
||||
android:name=".ui.support.HelpActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/faq"
|
||||
android:theme="@style/AppTheme.NoActionBar.Dark" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.settings.SettingActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.Dark" />
|
||||
<activity
|
||||
android:name=".ui.settings.GeneralSettingsActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.Dark" />
|
||||
<activity
|
||||
android:name=".ui.settings.UISettingsActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.Dark" />
|
||||
|
||||
<activity-alias
|
||||
android:name=".NeoLotMainActivity"
|
||||
android:targetActivity="io.neoterm.ui.term.NeoTermActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.IOT_LAUNCHER" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
<service
|
||||
android:name=".services.NeoTermService"
|
||||
android:enabled="true" />
|
||||
|
@ -1,4 +1,4 @@
|
||||
package io.neoterm.ui.about
|
||||
package io.neoterm.ui.support
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
@ -1,4 +1,4 @@
|
||||
package io.neoterm.ui.about
|
||||
package io.neoterm.ui.support
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.ActivityNotFoundException
|
27
app/src/main/java/io/neoterm/ui/support/HelpActivity.kt
Normal file
27
app/src/main/java/io/neoterm/ui/support/HelpActivity.kt
Normal file
@ -0,0 +1,27 @@
|
||||
package io.neoterm.ui.support
|
||||
|
||||
import android.os.Bundle
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import android.support.v7.widget.Toolbar
|
||||
import android.view.MenuItem
|
||||
import io.neoterm.R
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class HelpActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.ui_faq)
|
||||
setSupportActionBar(findViewById<Toolbar>(R.id.faq_toolbar))
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
|
||||
when (item?.itemId) {
|
||||
android.R.id.home ->
|
||||
finish()
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
110
app/src/main/res/layout/ui_faq.xml
Normal file
110
app/src/main/res/layout/ui_faq.xml
Normal file
@ -0,0 +1,110 @@
|
||||
<?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/faq_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="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">
|
||||
|
||||
<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="FAQ1"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
</LinearLayout>
|
||||
</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">
|
||||
|
||||
<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="FAQ2"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
@ -123,4 +123,5 @@
|
||||
<string name="support_donate_qq">QQ</string>
|
||||
<string name="support_donate_alipay">支付宝</string>
|
||||
<string name="new_color_scheme">新建配色方案</string>
|
||||
<string name="faq">常见问题</string>
|
||||
</resources>
|
@ -118,6 +118,7 @@
|
||||
<string name="about_credits_label">Acknowledgements</string>
|
||||
<string name="about_credits">nullptr for accompanying me\nCoolApk User @NimaQu for providing server\nQQ User @My for providing free network</string>
|
||||
<string name="new_color_scheme">New Color Scheme</string>
|
||||
<string name="faq">FAQ</string>
|
||||
|
||||
<string-array name="pref_general_shell_entries" translatable="false">
|
||||
<item>sh</item>
|
||||
|
@ -48,11 +48,19 @@
|
||||
</Preference>
|
||||
-->
|
||||
|
||||
<Preference
|
||||
android:icon="@drawable/ic_info_white_36dp"
|
||||
android:title="@string/faq" >
|
||||
<intent
|
||||
android:targetClass="io.neoterm.ui.support.HelpActivity"
|
||||
android:targetPackage="io.neoterm" />
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:icon="@drawable/ic_info_white_36dp"
|
||||
android:title="@string/about" >
|
||||
<intent
|
||||
android:targetClass="io.neoterm.ui.about.AboutActivity"
|
||||
android:targetClass="io.neoterm.ui.support.AboutActivity"
|
||||
android:targetPackage="io.neoterm" />
|
||||
</Preference>
|
||||
|
||||
|
Reference in New Issue
Block a user