Light dialog preference fixed + Purchase dialog theme

This commit is contained in:
serso 2015-02-09 23:03:38 +01:00
parent 46db2af173
commit 4a58f03ca3
3 changed files with 14 additions and 10 deletions

View File

@ -34,6 +34,7 @@ import jscl.NumeralBase;
import org.solovyev.android.calculator.math.MathType;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
import org.solovyev.android.calculator.preferences.BasePreferencesActivity;
import org.solovyev.android.calculator.preferences.PurchaseDialogActivity;
import org.solovyev.android.calculator.wizard.WizardActivity;
import org.solovyev.android.prefs.*;
import org.solovyev.android.view.VibratorContainer;
@ -114,7 +115,7 @@ public final class Preferences {
metro_purple_theme(R.style.cpp_metro_purple_theme),
metro_green_theme(R.style.cpp_metro_green_theme),
material_theme(R.style.Cpp_Theme_Material),
material_light_theme(R.style.Cpp_Theme_Material_Light, R.style.Cpp_Theme_Wizard_Light, R.style.Cpp_Theme_Settings_Light),
material_light_theme(R.style.Cpp_Theme_Material_Light, R.style.Cpp_Theme_Wizard_Light, R.style.Cpp_Theme_Settings_Light, R.style.Cpp_Theme_Dialog_Material_Light),
;
private static final SparseArray<TextColor> textColors = new SparseArray<>();
@ -122,15 +123,17 @@ public final class Preferences {
private final int themeId;
private final int wizardThemeId;
private final int settingsThemeId;
private final int dialogThemeId;
Theme(@StyleRes int themeId) {
this(themeId, R.style.Cpp_Theme_Wizard, R.style.Cpp_Theme_Settings);
this(themeId, R.style.Cpp_Theme_Wizard, R.style.Cpp_Theme_Settings, R.style.Cpp_Theme_Dialog_Material);
}
Theme(@StyleRes int themeId, @StyleRes int wizardThemeId, @StyleRes int settingsThemeId) {
Theme(@StyleRes int themeId, @StyleRes int wizardThemeId, @StyleRes int settingsThemeId, int dialogThemeId) {
this.themeId = themeId;
this.wizardThemeId = wizardThemeId;
this.settingsThemeId = settingsThemeId;
this.dialogThemeId = dialogThemeId;
}
public int getThemeId() {
@ -144,6 +147,9 @@ public final class Preferences {
if (context instanceof BasePreferencesActivity) {
return settingsThemeId;
}
if (context instanceof PurchaseDialogActivity) {
return dialogThemeId;
}
return themeId;
}

View File

@ -28,7 +28,6 @@ import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.TextView;
import android.support.v7.app.ActionBarActivity;
import org.solovyev.android.calculator.*;
import org.solovyev.android.checkout.*;
import org.solovyev.android.fragments.FragmentUtils;
@ -41,7 +40,7 @@ import javax.annotation.Nullable;
* Date: 1/20/13
* Time: 2:36 PM
*/
public class PurchaseDialogActivity extends ActionBarActivity {
public class PurchaseDialogActivity extends BaseActivity {
@Nonnull
private final ActivityCheckout checkout = Checkout.forActivity(this, App.getBilling(), App.getProducts());
@ -59,12 +58,14 @@ public class PurchaseDialogActivity extends ActionBarActivity {
}
};
public PurchaseDialogActivity() {
super(R.layout.cpp_dialog);
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cpp_dialog);
FragmentUtils.createFragment(this, PurchaseDialogFragment.class, R.id.dialog_layout, "purchase-dialog");
checkout.start();

View File

@ -85,8 +85,6 @@
</style>
<style name="Cpp.Theme.Light.Dialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:windowBackground">@color/cpp_main_bg_light</item>
<item name="colorPrimary">@color/cpp_material_light</item>
<item name="android:colorPrimary">@color/cpp_material_light</item>
<item name="colorPrimaryDark">@color/cpp_material_light</item>
@ -97,7 +95,6 @@
<item name="android:windowNoTitle">false</item>
<item name="android:windowTitleBackgroundStyle">@android:color/transparent</item>
<item name="windowActionBar">false</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowCloseOnTouchOutside">false</item>
<item name="cpp_main_bg">@color/cpp_main_bg_light</item>