Implement unfinished donation dialog
This commit is contained in:
@@ -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="24"
|
android:versionCode="25"
|
||||||
android:versionName="3.08b" >
|
android:versionName="3.09b" >
|
||||||
|
|
||||||
<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" />
|
||||||
@@ -23,7 +23,8 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".DonationsActivity" />
|
<activity android:name=".DonationsActivity"
|
||||||
|
android:theme="@style/GdxTheme" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ android {
|
|||||||
}
|
}
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "io.anuke.mindustry"
|
applicationId "io.anuke.mindustry"
|
||||||
minSdkVersion 9
|
minSdkVersion 11
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
|
|
||||||
jackOptions {
|
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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="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:id="@+id/donations_activity_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
</LinearLayout>
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</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>
|
<resources>
|
||||||
|
|
||||||
<style name="GdxTheme" parent="android:Theme">
|
<style name="GdxTheme" parent="android:Theme.Holo">
|
||||||
<item name="android:windowBackground">@android:color/transparent</item>
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||||
<item name="android:windowAnimationStyle">@android:style/Animation</item>
|
<item name="android:windowAnimationStyle">@android:style/Animation</item>
|
||||||
<item name="android:windowNoTitle">true</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.FragmentManager;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
|
||||||
import com.badlogic.gdx.backends.android.AndroidGraphics;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.donations.DonationsFragment;
|
import org.sufficientlysecure.donations.DonationsFragment;
|
||||||
|
|
||||||
public class DonationsActivity extends FragmentActivity {
|
public class DonationsActivity extends FragmentActivity {
|
||||||
@@ -18,9 +15,10 @@ public class DonationsActivity extends FragmentActivity {
|
|||||||
* Google
|
* 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_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",
|
private static final String[] GOOGLE_CATALOG = new String[]{
|
||||||
"ntpsync.donation.2", "ntpsync.donation.3", "ntpsync.donation.5", "ntpsync.donation.8",
|
"ntpsync.donation.1", "ntpsync.donation.2",
|
||||||
"ntpsync.donation.13"};
|
"ntpsync.donation.5", "ntpsync.donation.5",
|
||||||
|
"ntpsync.donation.8", "ntpsync.donation.13" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the activity is first created.
|
* Called when the activity is first created.
|
||||||
@@ -29,8 +27,10 @@ public class DonationsActivity extends FragmentActivity {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
setTheme(R.style.GdxTheme);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
setContentView(((AndroidGraphics)Gdx.graphics).getView());
|
setContentView(R.layout.donations_activity);
|
||||||
|
|
||||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
DonationsFragment donationsFragment;
|
DonationsFragment donationsFragment;
|
||||||
@@ -40,8 +40,10 @@ public class DonationsActivity extends FragmentActivity {
|
|||||||
null, false, null, null, false, null);
|
null, false, null, null, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
|
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
|
||||||
ft.commit();
|
ft.commit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import static io.anuke.mindustry.Vars.*;
|
|||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.core.GameState;
|
import io.anuke.mindustry.core.GameState;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.ui.MenuButton;
|
import io.anuke.mindustry.ui.MenuButton;
|
||||||
@@ -65,6 +66,11 @@ public class MenuFragment implements Fragment{
|
|||||||
//settings icon
|
//settings icon
|
||||||
new table(){{
|
new table(){{
|
||||||
atop().aright();
|
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), ()->{
|
new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{
|
||||||
ui.showAbout();
|
ui.showAbout();
|
||||||
}).get().pad(Unit.dp.inPixels(14));
|
}).get().pad(Unit.dp.inPixels(14));
|
||||||
|
|||||||
Reference in New Issue
Block a user