Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 6 (2.0) release Pullinga #1

Open
wants to merge 1 commit into
base: Pucresults_Pushbots
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.mosambitech.pucresults"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionCode 7
versionName "2.0"
}
buildTypes {
release {
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:label="Results App"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
Expand All @@ -38,7 +38,7 @@

<activity
android:name=".LaunchActivity"
android:label="@string/app_name"
android:label="Results"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -55,7 +55,8 @@

<activity
android:name=".ResultActivity"
android:label="Results"/>
android:label="Results"
android:screenOrientation="portrait"/>

<activity
android:name="com.google.android.gms.ads.AdActivity"
Expand Down
52 changes: 48 additions & 4 deletions app/src/main/java/com/mosambitech/pucresults/LaunchActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
import android.widget.Toast;

import com.beardedhen.androidbootstrap.TypefaceProvider;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.pushbots.push.Pushbots;

public class LaunchActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
View cet, sslc, puc, comedk;
AdRequest adRequest;

private InterstitialAd interstitial;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -29,6 +36,39 @@ protected void onCreate(Bundle savedInstanceState) {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

//adview

AdView adview = (AdView) this.findViewById(R.id.adview);
adRequest = new AdRequest.Builder().build();
adview.loadAd(adRequest);

//interstitials
interstitial = new InterstitialAd(LaunchActivity.this);
// Insert the Ad Unit ID
interstitial.setAdUnitId("ca-app-pub-9668220491500664/5847868231");

// Locate the Banner Ad in activity_main.xml

// Request for Ads
AdRequest adRequest = new AdRequest.Builder().build();

// Add a test device to show Test Ads

// Load ads into Banner Ads

// Load ads into Interstitial Ads
interstitial.loadAd(adRequest);

// Prepare an Interstitial Ad Listener
interstitial.setAdListener(new AdListener() {
public void onAdLoaded() {
// Call displayInterstitial() function
interstitial.show();
}
});



sslc = (View) findViewById(R.id.btn_sslc);
cet = (View) findViewById(R.id.btn_cet);
puc = (View) findViewById(R.id.btn_puc);
Expand All @@ -47,36 +87,40 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onClick(View v) {
Intent i = new Intent(LaunchActivity.this, ResultActivity.class);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);

i.putExtra("LANG_TAG", "SSLC");
startActivity(i);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
puc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(LaunchActivity.this, ResultActivity.class);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);

i.putExtra("LANG_TAG", "PUC");
startActivity(i);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
cet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(LaunchActivity.this, ResultActivity.class);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);

i.putExtra("LANG_TAG", "CET");
startActivity(i);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
comedk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(LaunchActivity.this, ResultActivity.class);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);

i.putExtra("LANG_TAG", "COMED K");
startActivity(i);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});

Expand Down
30 changes: 22 additions & 8 deletions app/src/main/res/layout/content_launch.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@color/titini_gold"
android:orientation="vertical"

app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.mosambitech.pucresults.LaunchActivity"
tools:showIn="@layout/app_bar_launch">

<ScrollView
android:id="@+id/sV"
android:layout_width="match_parent"

android:layout_height="match_parent">
android:layout_height="wrap_content"
android:layout_above="@+id/adview"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<RelativeLayout
android:id="@+id/relsub"
android:layout_width="match_parent"
Expand Down Expand Up @@ -106,6 +111,7 @@


</RelativeLayout>

<RelativeLayout
android:id="@+id/relsub2"
android:layout_width="match_parent"
Expand Down Expand Up @@ -188,4 +194,12 @@
</LinearLayout>
</ScrollView>

</RelativeLayout>
<com.google.android.gms.ads.AdView
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-9668220491500664/9713891434" />
</LinearLayout>