This file contains hidden or 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
<style name="TabLayout" parent="Widget.Design.TabLayout"> | |
<item name="tabTextAppearance">@style/MyCustomTabText</item> | |
<item name="tabSelectedTextColor">#fff</item> | |
</style> | |
<style name="MyCustomTabText" parent="TextAppearance.AppCompat.Button"> | |
<item name="android:textSize">14sp</item> | |
<item name="android:textColor">@android:color/darker_gray</item> | |
</style> |
This file contains hidden or 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"?> | |
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:background="#fafafa" | |
android:id="@+id/coordinatorLayout"> | |
<RelativeLayout | |
android:layout_width="match_parent" |
This file contains hidden or 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
import android.support.design.widget.CoordinatorLayout; | |
import android.support.design.widget.TabLayout; | |
import android.support.v4.app.Fragment; //Ogni classe deve appartenere al support.v4 | |
import android.os.Bundle; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import android.support.v4.view.ViewPager; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; |
This file contains hidden or 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
//Gli importi delle classi | |
import com.google.ads.AdRequest; | |
import com.google.ads.AdView; | |
// Va implementato appena sotto il metodo onCreate | |
AdView adview = (AdView)findViewById(R.id.adView); | |
AdRequest re = new AdRequest(); | |
adview.loadAd(re); |
This file contains hidden or 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
<!-- Gli xmlns obbligatori da utilizzare nel layout sono i seguenti | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" --> | |
<!-- Questo è il banner --> | |
<com.google.ads.AdView | |
android:id="@+id/adView" | |
android:layout_width="fill_parent" |
This file contains hidden or 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"?> | |
<resources> | |
<declare-styleable name="com.google.ads.AdView"> | |
<attr name="backgroundColor" format="color" /> | |
<attr name="primaryTextColor" format="color" /> | |
<attr name="secondaryTextColor" format="color" /> | |
<attr name="keywords" format="string" /> | |
<attr name="refreshInterval" format="integer" /> | |
</declare-styleable> | |
</resources> |
This file contains hidden or 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
<!-- aggiungere questi meta-data --> | |
<meta-data android:name="Nome del banner" | |
android:value="ID del banner"></meta-data> | |
<meta-data android:name="ADMOB_ALLOW_LOCATION_FOR_ADS" | |
android:value="false"></meta-data> | |
<!-- aggiungere questi permessi --> | |
This file contains hidden or 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
public class MainActivity extends FragmentActivity implements ActionBar.TabListener { | |
AppSectionsPagerAdapter mAppSectionsPagerAdapter; | |
ViewPager mViewPager; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// Settare il tipo di navigazione |
This file contains hidden or 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.view.ViewPager | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/pager" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> |
NewerOlder