mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 04:09:07 +07:00
Implement unfinished donation dialog
This commit is contained in:
parent
825251fa0a
commit
60f23b34e6
@ -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>
|
||||
|
||||
|
@ -33,7 +33,7 @@ android {
|
||||
}
|
||||
defaultConfig {
|
||||
applicationId "io.anuke.mindustry"
|
||||
minSdkVersion 9
|
||||
minSdkVersion 11
|
||||
targetSdkVersion 25
|
||||
|
||||
jackOptions {
|
||||
|
BIN
android/res/drawable/background.png
Normal file
BIN
android/res/drawable/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@ -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>
|
19
android/res/values-v21/styles.xml
Normal file
19
android/res/values-v21/styles.xml
Normal 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>
|
@ -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>
|
||||
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user