Skip to content

Commit

Permalink
Merge pull request #6 from seniorquico/notifications-and-uploads
Browse files Browse the repository at this point in the history
Added banner notifications and image uploads DEV-69 DEV-313 DEV-317
  • Loading branch information
seniorquico authored Mar 25, 2018
2 parents b9ca337 + b680ff6 commit 28842f7
Show file tree
Hide file tree
Showing 101 changed files with 2,502 additions and 2,717 deletions.
2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions demo-app/proguard-rules.pro

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':demo-app', ':zapic'
include ':zapic', ':zapic-demo'
File renamed without changes.
4 changes: 2 additions & 2 deletions demo-app/build.gradle → zapic-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName '1.0'
versionName '1.0.0'
}

buildTypes {
Expand All @@ -28,5 +28,5 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':zapic')
implementation 'com.android.support:support-annotations:27.0.2'
implementation 'com.android.support:support-annotations:27.1.0'
}
Empty file added zapic-demo/proguard-rules.pro
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
</intent-filter>
</activity>

<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/play_games_app_id" />
<meta-data android:name="com.google.android.gms.games.WEB_CLIENT_ID" android:value="@string/play_games_web_client_id" />
<meta-data
android:name="com.google.android.gms.games.APP_ID"
android:value="@string/play_games_app_id" />
<meta-data
android:name="com.google.android.gms.games.WEB_CLIENT_ID"
android:value="@string/play_games_web_client_id" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.zapic.androiddemo;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.PointF;
import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;

import com.zapic.android.sdk.Zapic;
import com.zapic.sdk.android.Zapic;

public class MainActivity extends Activity {
/**
Expand All @@ -36,7 +36,6 @@ public MainActivity() {
* Enables an immersive full-screen mode. This hides the system status and navigation bars until
* the user swipes in from the edges of the screen.
*/
@MainThread
private void enableImmersiveFullScreenMode() {
this.getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_FULLSCREEN
Expand All @@ -48,15 +47,21 @@ private void enableImmersiveFullScreenMode() {
| View.SYSTEM_UI_FLAG_LOW_PROFILE);
}

@MainThread
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Hide the system status and navigation bars.
this.enableImmersiveFullScreenMode();
this.getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(final int visibility) {
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
MainActivity.this.enableImmersiveFullScreenMode();
}
}
});

// Render the page.
super.onCreate(savedInstanceState);
this.setContentView(R.layout.activity_main);

final RelativeLayout zapicButton = this.findViewById(R.id.activity_main_zapic_button);
Expand All @@ -77,6 +82,7 @@ public void onClick(View v) {

this.findViewById(R.id.activity_main_container).setOnTouchListener(new View.OnTouchListener() {
@Override
@SuppressLint("ClickableViewAccessibility")
public boolean onTouch(View view, MotionEvent motionEvent) {
return MainActivity.this.onTouch(motionEvent);
}
Expand All @@ -86,7 +92,22 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
Zapic.attachFragment(this);
}

@MainThread
@Override
protected void onResume() {
// Hide the system status and navigation bars.
this.enableImmersiveFullScreenMode();
this.getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(final int visibility) {
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
MainActivity.this.enableImmersiveFullScreenMode();
}
}
});

super.onResume();
}

private boolean onTouch(@NonNull final MotionEvent motionEvent) {
switch (motionEvent.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
Expand Down Expand Up @@ -129,7 +150,6 @@ private boolean onTouch(@NonNull final MotionEvent motionEvent) {
return true;
}

@MainThread
@Override
public void onWindowFocusChanged(final boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/challenges_button_background" />
<corners android:bottomRightRadius="8dp" android:topRightRadius="8dp" />
<corners
android:bottomRightRadius="8dp"
android:topRightRadius="8dp" />
</shape>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/zapic_button_background" />
<corners android:bottomLeftRadius="8dp" android:topLeftRadius="8dp" />
<corners
android:bottomLeftRadius="8dp"
android:topLeftRadius="8dp" />
</shape>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
tools:context="com.zapic.androiddemo.MainActivity">
tools:context=".MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -13,6 +14,7 @@
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:orientation="horizontal">

<RelativeLayout
android:id="@+id/activity_main_zapic_button"
android:layout_width="0dp"
Expand All @@ -21,12 +23,14 @@
android:background="@drawable/zapic_button_background"
android:gravity="center"
android:padding="8dp">

<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
android:contentDescription="@string/zapic_button"
android:src="@drawable/logo" />
android:src="@drawable/zapic_logo_64dp" />
</RelativeLayout>

<RelativeLayout
android:id="@+id/activity_main_challenges_button"
android:layout_width="0dp"
Expand All @@ -35,6 +39,7 @@
android:background="@drawable/challenges_button_background"
android:gravity="center"
android:padding="8dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions zapic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
3 changes: 2 additions & 1 deletion zapic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-annotations:27.0.2'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:support-fragment:27.1.0'
implementation "com.google.android.gms:play-services-auth:${rootProject.ext.playServicesVersion}"
implementation "com.google.android.gms:play-services-games:${rootProject.ext.playServicesVersion}"
}
4 changes: 2 additions & 2 deletions zapic/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Keep Java API
-keep class com.zapic.android.sdk.Zapic {
-keep class com.zapic.sdk.android.Zapic {
public *;
}

# Keep JavaScript API
-keepclassmembers class com.zapic.android.sdk.AppJavaScriptBridge {
-keepclassmembers class com.zapic.sdk.android.WebViewJavascriptInterface {
public *;
}
18 changes: 15 additions & 3 deletions zapic/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zapic.android.sdk">
package="com.zapic.sdk.android">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application>
<activity android:name=".ZapicActivity"
<activity
android:name=".ZapicActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZapicActivityTheme" />

<meta-data
Expand All @@ -15,6 +18,15 @@
<meta-data
android:name="android.webkit.WebView.MetricsOptOut"
android:value="true" />
</application>

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.zapic"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
</application>
</manifest>
Loading

0 comments on commit 28842f7

Please sign in to comment.