編輯:關於android開發
主要練習了自定義樣式和主題,繼承android系統默認的樣式並修改,練習xml定義淡入淡出動畫
anim/fade_in.xml
<?xml version="1.0" encoding="utf-8"?> <alpha xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:fromAlpha="0.0" android:toAlpha="1.0" />
anim/fade_out.xml
<?xml version="1.0" encoding="utf-8"?> <alpha xmlns:android="http://schemas.android.com/apk/res/android" android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="3000"/>
values/styles.xml
<?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 自定義動畫樣式 --> <style name='fade' parent="@android:style/Animation.Activity"> <item name="android:activityOpenEnterAnimation">@anim/fade_in</item> <item name="android:activityOpenExitAnimation">@anim/fade_out</item> <item name="android:activityCloseEnterAnimation">@anim/fade_in</item> <item name="android:activityCloseExitAnimation">@anim/fade_out</item> </style> <!-- 自定義動畫主題 --> <style name="Theme.Tsh" parent="@android:style/Theme.Light.NoTitleBar"> <item name="android:windowAnimationStyle">@style/fade</item> </style> </resources>
MainActivity.java
package com.example.tsh; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; public class MainActivity extends Activity { private Handler handler=new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); handler.postDelayed(new Runnable() { @Override public void run() { Intent intent=new Intent(MainActivity.this, TwoActivity.class); startActivity(intent); } }, 3000); } }
Manifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tsh" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="ss" > <activity android:name=".MainActivity" android:label="首頁" android:theme="@style/Theme.Tsh" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".TwoActivity" android:theme="@style/Theme.Tsh" > </activity> </application> </manifest>
加載頁面遮擋耗時操作任務頁面--第三方開源--AndroidProgressLayout,androidview.layout 在Android的開發中,往往有這種需求,
在智能移動設備上打開浏覽器浏覽網頁是移動用戶很經常的操作。本文就來講解Andr
RecyclerView完全解析之結合AA(Android Annotations)注入框架實例(三十) (一).前言: 話說RecyclerView已經面市很久,
開源圖表庫MPAndroidChart使用介紹之餅狀圖&折線圖&柱狀圖,圖表mpandroidchart MPAndroidChart開源圖表庫之餅狀
解決 Could not find com.android.tools.