add: about page, settings, notification switch

This commit is contained in:
hyb1996
2017-02-03 10:41:23 +08:00
parent 636ce6d889
commit 5640b47663
47 changed files with 1392 additions and 307 deletions

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f9f9f9"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:title="@string/text_about"/>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/icon_container"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@android:color/white"
android:clickable="true"
android:foreground="?selectableItemBackgroundBorderless">
<ImageView
android:id="@+id/icon"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:src="@drawable/script_droid"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/icon"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="@string/version"
android:textColor="#777777"
android:textSize="14sp"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/activity_about_items"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:text="@string/copyright"
android:textColor="#777777"
android:textSize="14sp"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
android:src="@drawable/ic_share_white_48dp"
app:layout_anchor="@id/icon_container"
app:layout_anchorGravity="bottom|right|end"/>
</android.support.design.widget.CoordinatorLayout>

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="@android:color/white"
android:orientation="vertical">
<LinearLayout
android:id="@+id/developer"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:clickable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_developer_512"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/developer"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"/>
</LinearLayout>
<include layout="@layout/divider"/>
<LinearLayout
android:id="@+id/github"
android:layout_width="match_parent"
android:layout_height="52dp"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_github_mark"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/github"
android:textColor="@android:color/secondary_text_light"
android:textIsSelectable="true"
android:textSize="16sp"/>
</LinearLayout>
<include layout="@layout/divider"/>
<LinearLayout
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:clickable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_email_black_48dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/email"
android:textColor="@android:color/secondary_text_light"
android:textIsSelectable="true"
android:textSize="16sp"/>
</LinearLayout>
<include layout="@layout/divider"/>
<LinearLayout
android:id="@+id/qq"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:clickable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_qq_black"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/qq"
android:textColor="@android:color/secondary_text_light"
android:textIsSelectable="true"
android:textSize="16sp"/>
</LinearLayout>
<include layout="@layout/divider"/>
<LinearLayout
android:id="@+id/donate"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:clickable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_money_black"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/donate_developer"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"/>
</LinearLayout>
<include layout="@layout/divider"/>
</LinearLayout>

View File

@@ -0,0 +1,23 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</LinearLayout>

View File

@@ -0,0 +1,28 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/fragment_setting"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e4e4e4"
android:paddingEnd="16dp"
android:paddingStart="16dp"/>

View File

@@ -5,6 +5,28 @@
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/syntax_and_api"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="16dp"
android:src="@drawable/ic_js"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/text_syntax_and_api"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/auto_operate_service"
android:layout_width="match_parent"
@@ -39,27 +61,71 @@
</RelativeLayout>
<LinearLayout
android:id="@+id/syntax_and_api"
<RelativeLayout
android:id="@+id/assist_service"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon_assist_service"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_margin="16dp"
android:src="@drawable/ic_js"/>
android:src="@drawable/ic_service_green"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon_assist_service"
android:gravity="center"
android:text="@string/text_syntax_and_api"
android:text="@string/text_assist_service"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
<android.support.v7.widget.SwitchCompat
android:id="@+id/sw_assist_service"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/assist_service_notification"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon_assist_service_notification"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_margin="16dp"
android:src="@drawable/ic_notifications_green_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon_assist_service_notification"
android:gravity="center"
android:text="@string/text_assist_service_notification"
android:textColor="@android:color/primary_text_light"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/sw_assist_service_notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/stop_all_running_scripts"
@@ -83,47 +149,4 @@
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
<LinearLayout
android:id="@+id/about_app"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="16dp"
android:src="@drawable/ic_about_us_green_100px"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/text_about"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
<LinearLayout
android:id="@+id/licenses"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="16dp"
android:src="@drawable/ic_license_green"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/text_licenses"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>