Implement unfinished donation dialog

This commit is contained in:
Anuken 2017-12-12 01:38:24 -05:00
parent 825251fa0a
commit 60f23b34e6
8 changed files with 62 additions and 17 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry"
android:versionCode="24"
android:versionName="3.08b" >
android:versionCode="25"
android:versionName="3.09b" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
<uses-permission android:name="com.android.vending.BILLING" />
@ -23,7 +23,8 @@
</intent-filter>
</activity>
<activity android:name=".DonationsActivity" />
<activity android:name=".DonationsActivity"
android:theme="@style/GdxTheme" />
</application>

View File

@ -33,7 +33,7 @@ android {
}
defaultConfig {
applicationId "io.anuke.mindustry"
minSdkVersion 9
minSdkVersion 11
targetSdkVersion 25
jackOptions {

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -3,13 +3,30 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
android:orientation="vertical"
android:background="#000">
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:adjustViewBounds="false"
android:contentDescription="background"
android:cropToPadding="false"
android:scaleType="centerCrop"
android:src="@drawable/background" />
<LinearLayout
android:id="@+id/donations_activity_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="GdxTheme" parent="android:Theme.Material.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowFullscreen">true</item>
</style>
<style name="LightBackground" parent="android:Theme.Material.Light" >
<item name="android:colorBackground">@android:color/black</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
<item name="android:textColorSecondaryInverse">@android:color/white</item>
</style>
</resources>

View File

@ -1,7 +1,7 @@
<resources>
<style name="GdxTheme" parent="android:Theme">
<item name="android:windowBackground">@android:color/transparent</item>
<style name="GdxTheme" parent="android:Theme.Holo">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>

View File

@ -7,9 +7,6 @@ import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.android.AndroidGraphics;
import org.sufficientlysecure.donations.DonationsFragment;
public class DonationsActivity extends FragmentActivity {
@ -18,9 +15,10 @@ public class DonationsActivity extends FragmentActivity {
* Google
*/
private static final String GOOGLE_PUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg8bTVFK5zIg4FGYkHKKQ/j/iGZQlXU0qkAv2BA6epOX1ihbMz78iD4SmViJlECHN8bKMHxouRNd9pkmQKxwEBHg5/xDC/PHmSCXFx/gcY/xa4etA1CSfXjcsS9i94n+j0gGYUg69rNkp+p/09nO9sgfRTAQppTxtgKaXwpfKe1A8oqmDUfOnPzsEAG6ogQL6Svo6ynYLVKIvRPPhXkq+fp6sJ5YVT5Hr356yCXlM++G56Pk8Z+tPzNjjvGSSs/MsYtgFaqhPCsnKhb55xHkc8GJ9haq8k3PSqwMSeJHnGiDq5lzdmsjdmGkWdQq2jIhKlhMZMm5VQWn0T59+xjjIIwIDAQAB";
private static final String[] GOOGLE_CATALOG = new String[]{"ntpsync.donation.1",
"ntpsync.donation.2", "ntpsync.donation.3", "ntpsync.donation.5", "ntpsync.donation.8",
"ntpsync.donation.13"};
private static final String[] GOOGLE_CATALOG = new String[]{
"ntpsync.donation.1", "ntpsync.donation.2",
"ntpsync.donation.5", "ntpsync.donation.5",
"ntpsync.donation.8", "ntpsync.donation.13" };
/**
* Called when the activity is first created.
@ -29,8 +27,10 @@ public class DonationsActivity extends FragmentActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.GdxTheme);
//TODO
setContentView(((AndroidGraphics)Gdx.graphics).getView());
setContentView(R.layout.donations_activity);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
DonationsFragment donationsFragment;
@ -40,8 +40,10 @@ public class DonationsActivity extends FragmentActivity {
null, false, null, null, false, null);
}
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
ft.commit();
}
/**

View File

@ -4,6 +4,7 @@ import static io.anuke.mindustry.Vars.*;
import com.badlogic.gdx.Gdx;
import io.anuke.mindustry.Mindustry;
import io.anuke.mindustry.core.GameState;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.ui.MenuButton;
@ -65,6 +66,11 @@ public class MenuFragment implements Fragment{
//settings icon
new table(){{
atop().aright();
if(Mindustry.donationsCallable != null){
new imagebutton("icon-tools", Unit.dp.inPixels(30f), ()->{
Mindustry.donationsCallable.run();
}).get().pad(Unit.dp.inPixels(14));
}
new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{
ui.showAbout();
}).get().pad(Unit.dp.inPixels(14));