Commit d6bc71fcb55124d9dbe7831b2c27fab73775947b

Authored by 赵康
1 parent 0b6793f79c
Exists in master

add the project of demo

Showing 19 changed files with 504 additions and 0 deletions Side-by-side Diff

GameSDK-release4.1.0.aar
No preview for this file type
GameSDKDemo/.gitignore
... ... @@ -0,0 +1 @@
  1 +/build
GameSDKDemo/GameSDKDemo.iml
... ... @@ -0,0 +1,106 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<module external.linked.project.id=":GameSDKDemo" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../../../GameSDK_AS" external.system.id="GRADLE" external.system.module.group="GameSDK_AS" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
  3 + <component name="FacetManager">
  4 + <facet type="android-gradle" name="Android-Gradle">
  5 + <configuration>
  6 + <option name="GRADLE_PROJECT_PATH" value=":GameSDKDemo" />
  7 + </configuration>
  8 + </facet>
  9 + <facet type="android" name="Android">
  10 + <configuration>
  11 + <option name="SELECTED_BUILD_VARIANT" value="debug" />
  12 + <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
  13 + <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
  14 + <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
  15 + <afterSyncTasks>
  16 + <task>generateDebugSources</task>
  17 + </afterSyncTasks>
  18 + <option name="ALLOW_USER_CONFIGURATION" value="false" />
  19 + <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
  20 + <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
  21 + <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
  22 + <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
  23 + </configuration>
  24 + </facet>
  25 + </component>
  26 + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
  27 + <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
  28 + <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
  29 + <exclude-output />
  30 + <content url="file://$MODULE_DIR$">
  31 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
  32 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
  33 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
  34 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
  35 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
  36 + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
  37 + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
  38 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
  39 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
  40 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
  41 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
  42 + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
  43 + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
  44 + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
  45 + <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
  46 + <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
  47 + <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
  48 + <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
  49 + <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
  50 + <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
  51 + <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
  52 + <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
  53 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
  54 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
  55 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
  56 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
  57 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
  58 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
  59 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
  60 + <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
  61 + <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
  62 + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
  63 + <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
  64 + <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
  65 + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
  66 + <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
  67 + <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
  68 + <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
  69 + <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
  70 + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
  71 + <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
  72 + <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
  73 + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
  74 + <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
  75 + <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
  76 + <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
  77 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
  78 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
  79 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
  80 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
  81 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
  82 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
  83 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
  84 + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
  85 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
  86 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" />
  87 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" />
  88 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
  89 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
  90 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
  91 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
  92 + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
  93 + <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
  94 + </content>
  95 + <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
  96 + <orderEntry type="sourceFolder" forTests="false" />
  97 + <orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
  98 + <orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
  99 + <orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
  100 + <orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
  101 + <orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
  102 + <orderEntry type="module" module-name="GameSDK" exported="" />
  103 + <orderEntry type="library" exported="" name="image-cache" level="project" />
  104 + <orderEntry type="library" exported="" name="BluePay_3.6.2.0414pro" level="project" />
  105 + </component>
  106 +</module>
0 107 \ No newline at end of file
GameSDKDemo/build.gradle
... ... @@ -0,0 +1,38 @@
  1 +apply plugin: 'com.android.application'
  2 +
  3 +repositories{
  4 + flatDir{
  5 + dirs 'libs'
  6 + }
  7 +}
  8 +
  9 +android {
  10 + compileSdkVersion 22
  11 + buildToolsVersion "22.0.0"
  12 +
  13 +
  14 + defaultConfig {
  15 + minSdkVersion 9
  16 + targetSdkVersion 22
  17 + versionCode 1
  18 + versionName "1.0"
  19 + }
  20 +
  21 + buildTypes {
  22 + release {
  23 + minifyEnabled false
  24 + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  25 + }
  26 + }
  27 + lintOptions{
  28 + abortOnError false
  29 + }
  30 +}
  31 +
  32 +dependencies {
  33 + compile fileTree(dir: 'libs', include: ['*.jar'])
  34 + testCompile 'junit:junit:4.12'
  35 + compile 'com.android.support:appcompat-v7:22.2.0'
  36 + compile project(':GameSDK')
  37 +// compile(name:'GameSDK-release',ext:'aar')
  38 +}
GameSDKDemo/libs/GameSDK-release4.1.0.aar
No preview for this file type
GameSDKDemo/proguard-rules.pro
... ... @@ -0,0 +1,17 @@
  1 +# Add project specific ProGuard rules here.
  2 +# By default, the flags in this file are appended to flags specified
  3 +# in D:\DevTools\android-sdk-windows/tools/proguard/proguard-android.txt
  4 +# You can edit the include path and order by changing the proguardFiles
  5 +# directive in build.gradle.
  6 +#
  7 +# For more details, see
  8 +# http://developer.android.com/guide/developing/tools/proguard.html
  9 +
  10 +# Add any project specific keep options here:
  11 +
  12 +# If your project uses WebView with JS, uncomment the following
  13 +# and specify the fully qualified class name to the JavaScript interface
  14 +# class:
  15 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  16 +# public *;
  17 +#}
GameSDKDemo/src/androidTest/java/com/gumptech/sdk/demo/ApplicationTest.java
... ... @@ -0,0 +1,13 @@
  1 +package com.gumptech.sdk.demo;
  2 +
  3 +import android.app.Application;
  4 +import android.test.ApplicationTestCase;
  5 +
  6 +/**
  7 + * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
  8 + */
  9 +public class ApplicationTest extends ApplicationTestCase<Application> {
  10 + public ApplicationTest() {
  11 + super(Application.class);
  12 + }
  13 +}
0 14 \ No newline at end of file
GameSDKDemo/src/main/AndroidManifest.xml
... ... @@ -0,0 +1,80 @@
  1 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  2 + package="com.gumptech.sdk.demo">
  3 +
  4 +
  5 + <uses-sdk
  6 + android:minSdkVersion="9"
  7 + android:targetSdkVersion="20" />
  8 +
  9 + <uses-permission android:name="android.permission.INTERNET" />
  10 + <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  11 + <uses-permission android:name="android.permission.BLUETOOTH" />
  12 + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  13 + <uses-permission android:name="android.permission.WRITE_SETTINGS" />
  14 + <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  15 + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  16 + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  17 + <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
  18 + <uses-permission android:name="android.permission.SEND_SMS"/>
  19 +
  20 + <!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. -->
  21 + <uses-permission android:name="com.android.vending.BILLING" />
  22 +
  23 + <application
  24 + android:allowBackup="true"
  25 + android:icon="@drawable/ic_launcher"
  26 + android:label="@string/app_name" >
  27 + <activity
  28 + android:name="com.gumptech.sdk.demo.MainActivity"
  29 + android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout"
  30 + android:label="@string/app_name"
  31 + android:screenOrientation="portrait" >
  32 + <intent-filter>
  33 + <action android:name="android.intent.action.MAIN" />
  34 +
  35 + <category android:name="android.intent.category.LAUNCHER" />
  36 + </intent-filter>
  37 + </activity>
  38 + <activity
  39 + android:name="com.gumptech.sdk.ContainerActivity"
  40 + android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout"
  41 + android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
  42 + android:launchMode="singleTask"
  43 + android:theme="@style/Theme.TransparentWin" >
  44 + </activity>
  45 + <activity
  46 + android:name="com.gumptech.sdk.PaymentActivity"
  47 + android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout"
  48 + android:launchMode="singleTask"
  49 + android:theme="@android:style/Theme.Translucent.NoTitleBar" >
  50 + <intent-filter>
  51 + <category android:name="android.intent.category.DEFAULT" />
  52 +
  53 + <action android:name="android.intent.action.VIEW" />
  54 +
  55 + <category android:name="android.intent.category.BROWSABLE" />
  56 +
  57 + <data
  58 + android:host="com.gump.sdk"
  59 + android:scheme="gump10031" />
  60 + </intent-filter>
  61 + </activity>
  62 + <activity
  63 + android:name="com.gumptech.sdk.ExchangeWindow"
  64 + android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout"
  65 + android:theme="@style/Theme.WinForExchange" >
  66 + </activity>
  67 +
  68 + <service android:name="com.gumptech.sdk.PushService" >
  69 + </service>
  70 +
  71 + <!-- vk -->
  72 + <!-- <activity android:name="com.vk.sdk.VKOpenAuthActivity" /> -->
  73 + <!-- <activity -->
  74 + <!-- android:name="com.vk.sdk.VKServiceActivity" -->
  75 + <!-- android:label="ServiceActivity" -->
  76 + <!-- android:theme="@style/VK.Transparent" /> -->
  77 + </application>
  78 +
  79 +
  80 +</manifest>
GameSDKDemo/src/main/java/com/gumptech/sdk/demo/MainActivity.java
... ... @@ -0,0 +1,158 @@
  1 +package com.gumptech.sdk.demo;
  2 +
  3 +import android.app.Activity;
  4 +import android.content.Context;
  5 +import android.os.Bundle;
  6 +import android.text.ClipboardManager;
  7 +import android.util.Log;
  8 +import android.view.View;
  9 +import android.widget.Button;
  10 +import android.widget.TextView;
  11 +import android.widget.Toast;
  12 +
  13 +import com.gumptech.sdk.GumpPreference;
  14 +import com.gumptech.sdk.GumpSDK;
  15 +import com.gumptech.sdk.bean.GumpUser;
  16 +import com.gumptech.sdk.bean.PurchaseResult;
  17 +import com.gumptech.sdk.callback.InitializeCallback;
  18 +import com.gumptech.sdk.callback.LoginStateListener;
  19 +import com.gumptech.sdk.callback.PurchaseCallback;
  20 +
  21 +public class MainActivity extends Activity implements PurchaseCallback{
  22 +
  23 + private static final String TAG = "MainActivity";
  24 +
  25 + private TextView tvVersion;
  26 + private TextView userInfo;
  27 +
  28 + private Button btnLoginOrLogout;
  29 +
  30 + private String appId = "10056";
  31 + private String appKey = "b59c21a078fde074a6750e91ed19fb21";
  32 + private String sessionKey;
  33 +
  34 + @Override
  35 + protected void onCreate(Bundle savedInstanceState) {
  36 + super.onCreate(savedInstanceState);
  37 + setContentView(R.layout.activity_main);
  38 + tvVersion = (TextView) findViewById(R.id.version);
  39 + userInfo = (TextView) findViewById(R.id.user_info);
  40 + btnLoginOrLogout = (Button) findViewById(R.id.login_or_logout);
  41 + btnLoginOrLogout.setOnClickListener(new View.OnClickListener() {
  42 +
  43 + @Override
  44 + public void onClick(View v) {
  45 + if (btnLoginOrLogout.getTag() == null || (Integer) btnLoginOrLogout.getTag() == 0)
  46 + GumpSDK.start(MainActivity.this);
  47 + else
  48 + GumpSDK.logout(MainActivity.this);
  49 + }
  50 + });
  51 + findViewById(R.id.pay).setOnClickListener(new View.OnClickListener() {
  52 +
  53 + @Override
  54 + public void onClick(View v) {
  55 + Bundle payInfo = new Bundle();
  56 + payInfo.putString("nick", "thi");
  57 + payInfo.putString("product", "test2");
  58 + payInfo.putFloat("amount", 0.1f);
  59 + payInfo.putString("extraInfo", "This is demo!");
  60 + payInfo.putString("serverId", "100");
  61 + payInfo.putString("sessionKey", sessionKey);
  62 + GumpSDK.pay(MainActivity.this, payInfo, MainActivity.this);
  63 + }
  64 + });
  65 + /**
  66 + * 设置否是打印debug日志
  67 + */
  68 + GumpSDK.getSettings().enableDebugLogging(true);
  69 + /**
  70 + * 设置是否启用facebook登录
  71 + */
  72 + GumpSDK.getSettings().setFBEnable(true);
  73 + /**
  74 + * 设置是否启用Vk登录
  75 + */
  76 + GumpSDK.getSettings().setVKEnable(false);
  77 + /**
  78 + * 设置屏幕方向
  79 + */
  80 + GumpSDK.getSettings().setScreenLandscape(true);
  81 + /**
  82 + * 设置用户登录状态监听器
  83 + */
  84 +
  85 + GumpSDK.setUserStateListener(new LoginStateListener() {
  86 + @Override
  87 + public void onLoginSuccess(GumpUser user) {
  88 + ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
  89 + cm.setText(user.getSessionKey());
  90 + sessionKey = user.getSessionKey();
  91 + String userType=null;
  92 + switch(user.getAccountType()){
  93 + case GumpPreference.ACCOUNT_TYPE_FB:
  94 + userType = "Facebook登录";
  95 + break;
  96 + case GumpPreference.ACCOUNT_TYPE_QUICK_REG:
  97 + userType = "快速登录";
  98 + break;
  99 + case GumpPreference.ACCOUNT_TYPE_REG:
  100 + userType = "gump注册用户";
  101 + break;
  102 + case GumpPreference.ACCOUNT_TYPE_VK:
  103 + userType = "vk登录";
  104 + break;
  105 + }
  106 + userInfo.setText(" Userid:" + user.getUid() + "\n accountType:(" + user.getAccountType()+") "+userType + "\n sessionKey:" + user.getSessionKey());
  107 + btnLoginOrLogout.setText("Logout");
  108 + btnLoginOrLogout.setTag(1);
  109 + }
  110 +
  111 + @Override
  112 + public void onLoginFailed(int code, String msg) {
  113 + userInfo.setText(msg);
  114 + Toast.makeText(MainActivity.this, "Login failed:code="+code+",message="+msg, Toast.LENGTH_SHORT).show();
  115 + }
  116 +
  117 + @Override
  118 + public void onLoginCanceled() {
  119 + Toast.makeText(MainActivity.this, "operate be canceled", Toast.LENGTH_SHORT).show();
  120 + }
  121 +
  122 + @Override
  123 + public void onLogout() {
  124 + btnLoginOrLogout.setText("Login");
  125 + btnLoginOrLogout.setTag(0);
  126 + userInfo.setText("User is logout");
  127 + }
  128 + });
  129 + /**
  130 + * 初始化sdk
  131 + */
  132 + GumpSDK.init(getApplicationContext(), appId, appKey, "1000", new InitializeCallback() {
  133 + @Override
  134 + public void initComplete(int result) {
  135 + if (result == GumpSDK.CODE.OK) {
  136 + btnLoginOrLogout.setEnabled(true);
  137 + }
  138 + }
  139 + });
  140 +
  141 + tvVersion.setText("SDK Version:" + GumpSDK.getVersion());
  142 + }
  143 +
  144 + @Override
  145 + public void onPurchaseCompleted(PurchaseResult result) {
  146 + Log.i(TAG,"purchase completed");
  147 + }
  148 +
  149 + @Override
  150 + public void onPurchaseError(int code, String msg) {
  151 + Log.i(TAG,"purchase error");
  152 + }
  153 +
  154 + @Override
  155 + public void onPurchaseCanceled() {
  156 + Log.i(TAG,"purchase canceled");
  157 + }
  158 +}
GameSDKDemo/src/main/res/drawable-hdpi/ic_launcher.png

7.23 KB

GameSDKDemo/src/main/res/drawable-mdpi/ic_launcher.png

4.73 KB

GameSDKDemo/src/main/res/drawable-xhdpi/ic_launcher.png

9.91 KB

GameSDKDemo/src/main/res/layout/activity_main.xml
... ... @@ -0,0 +1,33 @@
  1 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:layout_width="match_parent"
  3 + android:layout_height="match_parent"
  4 + android:background="@android:color/white"
  5 + android:orientation="vertical" >
  6 +
  7 + <TextView
  8 + android:id="@+id/version"
  9 + android:layout_width="wrap_content"
  10 + android:layout_height="wrap_content"
  11 + android:layout_gravity="center_horizontal"
  12 + android:textColor="@color/black_text" />
  13 +
  14 + <TextView
  15 + android:id="@+id/user_info"
  16 + android:layout_width="wrap_content"
  17 + android:layout_height="wrap_content"
  18 + android:textColor="@android:color/black" />
  19 +
  20 + <Button
  21 + android:id="@+id/login_or_logout"
  22 + android:layout_width="wrap_content"
  23 + android:layout_height="wrap_content"
  24 + android:enabled="false"
  25 + android:text="Login" />
  26 +
  27 + <Button
  28 + android:id="@+id/pay"
  29 + android:layout_width="wrap_content"
  30 + android:layout_height="wrap_content"
  31 + android:text="pay" />
  32 +
  33 +</LinearLayout>
0 34 \ No newline at end of file
GameSDKDemo/src/main/res/values-w820dp/dimens.xml
... ... @@ -0,0 +1,10 @@
  1 +<resources>
  2 +
  3 + <!--
  4 + Example customization of dimensions originally defined in res/values/dimens.xml
  5 + (such as screen margins) for screens with more than 820dp of available width. This
  6 + would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
  7 + -->
  8 + <dimen name="activity_horizontal_margin">64dp</dimen>
  9 +
  10 +</resources>
GameSDKDemo/src/main/res/values/colors.xml
... ... @@ -0,0 +1,6 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 + <color name="colorPrimary">#3F51B5</color>
  4 + <color name="colorPrimaryDark">#303F9F</color>
  5 + <color name="colorAccent">#FF4081</color>
  6 +</resources>
GameSDKDemo/src/main/res/values/dimens.xml
... ... @@ -0,0 +1,7 @@
  1 +<resources>
  2 +
  3 + <!-- Default screen margins, per the Android Design guidelines. -->
  4 + <dimen name="activity_horizontal_margin">16dp</dimen>
  5 + <dimen name="activity_vertical_margin">16dp</dimen>
  6 +
  7 +</resources>
GameSDKDemo/src/main/res/values/strings.xml
... ... @@ -0,0 +1,9 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 +
  4 + <string name="app_name">GameSDKSample</string>
  5 + <string name="hello_world">Hello world!</string>
  6 + <string name="action_settings">Settings</string>
  7 +
  8 +</resources>
  9 +
0 10 \ No newline at end of file
GameSDKDemo/src/main/res/values/styles.xml
... ... @@ -0,0 +1,11 @@
  1 +<resources>
  2 +
  3 + <!-- Base application theme. -->
  4 + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  5 + <!-- Customize your theme here. -->
  6 + <item name="colorPrimary">@color/colorPrimary</item>
  7 + <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
  8 + <item name="colorAccent">@color/colorAccent</item>
  9 + </style>
  10 +
  11 +</resources>
GameSDKDemo/src/test/java/com/gumptech/sdk/demo/ExampleUnitTest.java
... ... @@ -0,0 +1,15 @@
  1 +package com.gumptech.sdk.demo;
  2 +
  3 +import org.junit.Test;
  4 +
  5 +import static org.junit.Assert.*;
  6 +
  7 +/**
  8 + * To work on unit tests, switch the Test Artifact in the Build Variants view.
  9 + */
  10 +public class ExampleUnitTest {
  11 + @Test
  12 + public void addition_isCorrect() throws Exception {
  13 + assertEquals(4, 2 + 2);
  14 + }
  15 +}
0 16 \ No newline at end of file