提交 0e6ea649 编写于 作者: W whl1208@126.com

更新SplashActivity以及版本号

上级 2cbba45b
......@@ -7,9 +7,9 @@ android {
defaultConfig {
applicationId "org.easydarwin.easyplayer"
minSdkVersion 16
targetSdkVersion 23
versionCode 2
versionName "1.0.0423"
targetSdkVersion 21
versionCode 3
versionName "1.0.16.0423"
}
buildTypes {
release {
......
......@@ -38,7 +38,7 @@
</intent-filter>
</activity>
<activity
android:name="org.easydarwin.easyplayer.Splash"
android:name="org.easydarwin.easyplayer.SplashActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_splash"
android:theme="@style/FullscreenTheme"></activity>
......
......@@ -66,7 +66,7 @@ public class PlaylistActivity extends AppCompatActivity implements View.OnClickL
});
if (savedInstanceState == null){
startActivity(new Intent(this, Splash.class));
startActivity(new Intent(this, SplashActivity.class));
}
}
......
package org.easydarwin.easyplayer;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MotionEvent;
import android.view.View;
import org.esaydarwin.rtsp.player.R;
/**
* An example full-screen activity that shows and hides the system UI (i.e.
* status bar and navigation/system bar) with user interaction.
*/
public class Splash extends AppCompatActivity {
/**
* Whether or not the system UI should be auto-hidden after
* {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds.
*/
private static final boolean AUTO_HIDE = true;
/**
* If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after
* user interaction before hiding the system UI.
*/
private static final int AUTO_HIDE_DELAY_MILLIS = 3000;
/**
* Some older devices needs a small delay between UI widget updates
* and a change of the status and navigation bar.
*/
private static final int UI_ANIMATION_DELAY = 300;
private final Handler mHideHandler = new Handler();
private final Runnable mHidePart2Runnable = new Runnable() {
@SuppressLint("InlinedApi")
@Override
public void run() {
// Delayed removal of status and navigation bar
// Note that some of these constants are new as of API 16 (Jelly Bean)
// and API 19 (KitKat). It is safe to use them, as they are inlined
// at compile-time and do nothing on earlier devices.
}
};
private final Runnable mShowPart2Runnable = new Runnable() {
@Override
public void run() {
// Delayed display of UI elements
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.show();
}
}
};
private boolean mVisible;
private final Runnable mHideRunnable = new Runnable() {
@Override
public void run() {
hide();
}
};
/**
* Touch listener to use for in-layout UI controls to delay hiding the
* system UI. This is to prevent the jarring behavior of controls going away
* while interacting with activity UI.
*/
private final View.OnTouchListener mDelayHideTouchListener = new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (AUTO_HIDE) {
delayedHide(AUTO_HIDE_DELAY_MILLIS);
}
return false;
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Trigger the initial hide() shortly after the activity has been
// created, to briefly hint to the user that UI controls
// are available.
delayedHide(0);
mHideHandler.postDelayed(new Runnable() {
@Override
public void run() {
finish();
}
}, 1500);
}
private void hide() {
// Hide UI first
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.hide();
}
// Schedule a runnable to remove the status and navigation bar after a delay
mHideHandler.removeCallbacks(mShowPart2Runnable);
mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);
}
@SuppressLint("InlinedApi")
private void show() {
// Show the system bar
mVisible = true;
// Schedule a runnable to display UI elements after a delay
mHideHandler.removeCallbacks(mHidePart2Runnable);
mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);
}
/**
* Schedules a call to hide() in [delay] milliseconds, canceling any
* previously scheduled calls.
*/
private void delayedHide(int delayMillis) {
mHideHandler.removeCallbacks(mHideRunnable);
mHideHandler.postDelayed(mHideRunnable, delayMillis);
}
}
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
tools:context="org.easydarwin.easyplayer.Splash">
android:orientation="vertical" >
<ImageView
android:id="@+id/logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:contentDescription="@null"
android:src="@mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:drawableTop="@drawable/img_qrcode"
android:layout_gravity="center"
android:id="@+id/txt_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/logo"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true"
android:text="EasyPlayer 1.0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:gravity="center"
android:drawablePadding="@dimen/activity_vertical_margin"
android:text="EasyPlayer v1.0.16.0403"
android:layout_height="wrap_content" />
</FrameLayout>
android:text="Copyright 2012-2016 www.EasyDarwin.org" />
</RelativeLayout>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册