api: colors.isSimilar, colors.equals
fix: circular menu icon is not circular when recording feat: splash ui for built apk docs: update to latest docs fix: floating menu not showing automatically
This commit is contained in:
@@ -18,6 +18,12 @@
|
||||
android:theme="@style/AppTheme"
|
||||
tools:replace="android:label, android:allowBackup">
|
||||
<activity android:name=".MainActivity">
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".SplashActivity"
|
||||
android:theme="@style/AppTheme.Splash">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
|
||||
BIN
inrt/src/main/assets/roboto_medium.ttf
Normal file
BIN
inrt/src/main/assets/roboto_medium.ttf
Normal file
Binary file not shown.
@@ -9,6 +9,7 @@ import android.preference.PreferenceManager;
|
||||
|
||||
public class Pref {
|
||||
|
||||
private static final String KEY_FIRST_USING = "key_first_using";
|
||||
private static SharedPreferences sPreferences;
|
||||
|
||||
public static SharedPreferences getPreferences() {
|
||||
@@ -36,4 +37,12 @@ public class Pref {
|
||||
public static boolean shouldStopAllScriptsWhenVolumeUp() {
|
||||
return getPreferences().getBoolean(getString(R.string.key_use_volume_control_running), true);
|
||||
}
|
||||
|
||||
public static boolean isFirstUsing() {
|
||||
boolean firstUsing = getPreferences().getBoolean(KEY_FIRST_USING, true);
|
||||
if (firstUsing) {
|
||||
getPreferences().edit().putBoolean(KEY_FIRST_USING, false).apply();
|
||||
}
|
||||
return firstUsing;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ public class SettingsActivity extends AppCompatActivity {
|
||||
getFragmentManager().beginTransaction().replace(R.id.fragment_setting, new PreferenceFragment()).commit();
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
toolbar.setTitle(R.string.text_settings);
|
||||
toolbar.setNavigationOnClickListener(v -> finish());
|
||||
setSupportActionBar(toolbar);
|
||||
toolbar.setNavigationOnClickListener(v -> finish());
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.stardust.auojs.inrt;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2018/2/2.
|
||||
*/
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (!Pref.isFirstUsing()) {
|
||||
main();
|
||||
return;
|
||||
}
|
||||
setContentView(R.layout.activity_splash);
|
||||
TextView slug = (TextView) findViewById(R.id.slug);
|
||||
slug.setTypeface(Typeface.createFromAsset(getAssets(), "roboto_medium.ttf"));
|
||||
new Handler().postDelayed(this::main, 2500);
|
||||
}
|
||||
|
||||
private void main() {
|
||||
startActivity(new Intent(this, MainActivity.class));
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
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="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
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="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
22
inrt/src/main/res/layout/activity_splash.xml
Normal file
22
inrt/src/main/res/layout/activity_splash.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/autojs_material"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/slug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:text="@string/powered_by_autojs"
|
||||
android:textColor="#dd000000"
|
||||
android:textSize="14sp"/>
|
||||
</FrameLayout>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
||||
@@ -19,4 +19,5 @@
|
||||
<string name="key_dont_show_main_activity">key_dont_show_main_activity</string>
|
||||
<string name="summary_dont_show_main_activity">打开应用后直接运行脚本</string>
|
||||
<string name="text_others">其他</string>
|
||||
<string name="powered_by_autojs">Powered by Auto.js</string>
|
||||
</resources>
|
||||
|
||||
@@ -8,4 +8,15 @@
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Splash" parent="@android:style/Theme.Light.NoTitleBar.Fullscreen">
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user