Balanced maps, fixed donation dialog crash

This commit is contained in:
Anuken
2017-12-12 21:37:25 -05:00
parent 84c5938236
commit 1554d998bf
10 changed files with 28 additions and 9 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry" package="io.anuke.mindustry"
android:versionCode="27" android:versionCode="28"
android:versionName="3.0" > android:versionName="3.01" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" /> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
<uses-permission android:name="com.android.vending.BILLING" /> <uses-permission android:name="com.android.vending.BILLING" />

View File

@ -1,15 +1,18 @@
package io.anuke.mindustry; package io.anuke.mindustry;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.Button;
import org.sufficientlysecure.donations.DonationsFragment; import org.sufficientlysecure.donations.DonationsFragment;
public class DonationsActivity extends FragmentActivity { public class DonationsActivity extends FragmentActivity {
DonationsFragment donationsFragment;
/** /**
* Google * Google
@ -33,7 +36,6 @@ public class DonationsActivity extends FragmentActivity {
setContentView(R.layout.donations_activity); setContentView(R.layout.donations_activity);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
DonationsFragment donationsFragment;
if (BuildConfig.DONATIONS_GOOGLE) { if (BuildConfig.DONATIONS_GOOGLE) {
donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG, donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG,
getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null, getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null,
@ -43,9 +45,21 @@ public class DonationsActivity extends FragmentActivity {
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment"); ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
ft.commit(); ft.commit();
} }
public void onStart(){
super.onStart();
Button b = ((Button)findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button));
b.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
donationsFragment.donateGoogleOnClick(donationsFragment.getView());
b.setEnabled(false);
}
});
}
/** /**
* Needed for Google Play In-app Billing. It uses startIntentSenderForResult(). The result is not propagated to * Needed for Google Play In-app Billing. It uses startIntentSenderForResult(). The result is not propagated to
* the Fragment like in startActivityForResult(). Thus we need to propagate manually to our Fragment. * the Fragment like in startActivityForResult(). Thus we need to propagate manually to our Fragment.
@ -53,6 +67,8 @@ public class DonationsActivity extends FragmentActivity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
Button b = ((Button)findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button));
b.setEnabled(true);
FragmentManager fragmentManager = getSupportFragmentManager(); FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment"); Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
@ -61,5 +77,4 @@ public class DonationsActivity extends FragmentActivity {
//TODO donation event, set settings //TODO donation event, set settings
} }
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -6,7 +6,7 @@ canvas {
} }
body { body {
background-color: transparent; background-color: #191919;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
@ -17,3 +17,7 @@ body {
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f4ba6e),color-stop(1, #d29d58)) !important; background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f4ba6e),color-stop(1, #d29d58)) !important;
background-image: -webkit-linear-gradient(#f4ba6e, #d29d58) !important; background-image: -webkit-linear-gradient(#f4ba6e, #d29d58) !important;
} }
.gdx-meter {
max-width: 100% !important;
}