mirror of
https://github.com/moparisthebest/android-app
synced 2024-11-15 05:15:04 -05:00
using support library 21 to add material action bar.
This commit is contained in:
parent
d25265e781
commit
53ee178452
@ -80,6 +80,9 @@
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-21.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-21.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-21.0.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
@ -20,5 +20,5 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// compile 'com.android.support:appcompat-v7:20.0.0'
|
||||
compile 'com.android.support:appcompat-v7:21.0.0'
|
||||
}
|
||||
|
@ -5,9 +5,10 @@ import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.view.MenuItem;
|
||||
|
||||
public class BaseActionBarActivity extends Activity {
|
||||
public class BaseActionBarActivity extends ActionBarActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -19,7 +20,7 @@ public class BaseActionBarActivity extends Activity {
|
||||
protected void addBackButtonToActionBar() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
try {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
} catch (Exception e) {
|
||||
//
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="app_theme" parent="android:Theme.Holo.Light"/>
|
||||
<style name="mainActivity_theme" parent="android:Theme.Holo.Light" />
|
||||
</resources>
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="app_theme" parent="android:Theme.DeviceDefault.Light.DarkActionBar"/>
|
||||
<style name="mainActivity_theme" parent="android:Theme.DeviceDefault.Light.NoActionBar" />
|
||||
</resources>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="app_theme" parent="android:Theme.Light"/>
|
||||
<style name="mainActivity_theme" parent="android:Theme.Light.NoTitleBar" />
|
||||
<style name="app_theme" parent="Theme.AppCompat.Light.DarkActionBar"/>
|
||||
<style name="mainActivity_theme" parent="Theme.AppCompat.Light.NoActionBar" />
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user