This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.YvesB.Nexus; | |
//Importare | |
import android.app.ActionBar; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.MenuItem; | |
//Definire il Layout che verrà utilizzato |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.YvesB.Nexus; | |
import android.os.Bundle; | |
import android.view.MenuInflater; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
import android.widget.PopupMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@android:id/text1" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:textAppearance="?android:attr/textAppearanceListItemSmall" | |
android:gravity="center_vertical" | |
android:paddingLeft="16dp" | |
android:paddingRight="16dp" | |
android:textColor="#000" | |
android:background="?android:attr/activatedBackgroundIndicator" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.v4.widget.DrawerLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/drawer_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ImageView | |
android:id="@+id/image" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.YvesB.Nexus; | |
import android.app.Activity; | |
import android.app.Fragment; | |
import android.app.FragmentManager; | |
import android.content.Intent; | |
import android.content.res.Configuration; | |
import android.os.Bundle; | |
import android.support.v4.app.ActionBarDrawerToggle; | |
import android.support.v4.view.GravityCompat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.YvesB.Nexus; | |
import android.app.ActionBar; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.MenuItem; | |
public class Setting extends Activity { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.YvesB.Nexus" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk | |
android:minSdkVersion="15" | |
android:targetSdkVersion="17" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
..... | |
<uses-sdk | |
android:minSdkVersion="15" | |
android:targetSdkVersion="18" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@drawable/ic_launcher" | |
android:label="@string/app_name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setta Action Bar | |
ActionBar actionbar = getActionBar(); | |
// Setta il titolo | |
actionbar.setTitle("Titolo"); | |
// Setta il sottotitolo | |
actionbar.setSubtitle("Sottotitolo"); | |
// Setta una icona differente |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
switch (item.getItemId()) { | |
case R.id.alert: | |
alert(); | |
return true; |
OlderNewer