Merge branch 'admob'
This commit is contained in:
@@ -53,4 +53,6 @@ dependencies {
|
|||||||
compile('com.mikepenz:aboutlibraries:5.3.6@aar') {
|
compile('com.mikepenz:aboutlibraries:5.3.6@aar') {
|
||||||
transitive = true
|
transitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compile 'com.google.android.gms:play-services-ads:8.3.0'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.google.android.gms.ads.AdRequest;
|
||||||
|
import com.google.android.gms.ads.AdView;
|
||||||
|
|
||||||
import net.headlezz.notificationlogger.createnotification.NotificationCreationFragment;
|
import net.headlezz.notificationlogger.createnotification.NotificationCreationFragment;
|
||||||
import net.headlezz.notificationlogger.logger.LoggerUtils;
|
import net.headlezz.notificationlogger.logger.LoggerUtils;
|
||||||
import net.headlezz.notificationlogger.notificationlist.NotificationListFragment;
|
import net.headlezz.notificationlogger.notificationlist.NotificationListFragment;
|
||||||
@@ -30,6 +33,9 @@ public class MainActivity extends AppCompatActivity implements SharedPreferences
|
|||||||
@Bind(R.id.main_menu_fab_add_notification)
|
@Bind(R.id.main_menu_fab_add_notification)
|
||||||
FloatingActionButton mFAB;
|
FloatingActionButton mFAB;
|
||||||
|
|
||||||
|
@Bind(R.id.adView)
|
||||||
|
AdView mAdView;
|
||||||
|
|
||||||
SharedPreferences mSharedPrefs;
|
SharedPreferences mSharedPrefs;
|
||||||
|
|
||||||
LoggerWarningPresenter mLoggerWarningPresenter;
|
LoggerWarningPresenter mLoggerWarningPresenter;
|
||||||
@@ -57,6 +63,14 @@ public class MainActivity extends AppCompatActivity implements SharedPreferences
|
|||||||
.add(R.id.main_menu_fragment_container, new NotificationListFragment())
|
.add(R.id.main_menu_fragment_container, new NotificationListFragment())
|
||||||
.commit();
|
.commit();
|
||||||
}
|
}
|
||||||
|
setupAdView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupAdView() {
|
||||||
|
AdRequest req = new AdRequest.Builder()
|
||||||
|
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
|
||||||
|
.build();
|
||||||
|
mAdView.loadAd(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/viewholder"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/viewholder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/adView">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
@@ -30,3 +36,14 @@
|
|||||||
android:src="@drawable/ic_action_add"
|
android:src="@drawable/ic_action_add"
|
||||||
app:fabSize="normal" />
|
app:fabSize="normal" />
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
<com.google.android.gms.ads.AdView
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:id="@+id/adView"
|
||||||
|
app:adSize="BANNER"
|
||||||
|
app:adUnitId="@string/banner_ad_unit_id"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentEnd="true" />
|
||||||
|
</RelativeLayout>
|
||||||
4
app/src/main/res/values/system_strings.xml
Normal file
4
app/src/main/res/values/system_strings.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="banner_ad_unit_id">ca-app-pub-0000000000000000/0000000000</string>
|
||||||
|
</resources>
|
||||||
Reference in New Issue
Block a user