lets be a bit more stylish

This commit is contained in:
tibbi 2016-06-01 15:10:45 +02:00
parent b666f121b8
commit 61d68dd31f
7 changed files with 18 additions and 14 deletions

View File

@ -54,10 +54,10 @@ public class MainActivity extends AppCompatActivity implements Calculator {
private void setupResultView() {
final Resources res = getResources();
result.setBackgroundColor(res.getColor(android.R.color.white));
result.setTextColor(res.getColor(R.color.dark_grey));
result.setTextColor( res.getColor(R.color.text_grey));
formula.setBackgroundColor(res.getColor(android.R.color.white));
formula.setTextColor(res.getColor(R.color.dark_grey));
formula.setTextColor(res.getColor(R.color.text_grey));
}
@OnClick(R.id.btn_plus)

View File

@ -56,7 +56,7 @@ public class MyWidgetConfigure extends AppCompatActivity {
bgColor = prefs.getInt(Constants.WIDGET_BG_COLOR, 1);
if (bgColor == 1) {
bgColor = Color.BLACK;
bgAlpha = .5f;
bgAlpha = .2f;
} else {
bgAlpha = Color.alpha(bgColor) / (float) 255;
}
@ -67,7 +67,7 @@ public class MyWidgetConfigure extends AppCompatActivity {
bgSeekBar.setProgress((int) (bgAlpha * 100));
updateBackgroundColor();
textColor = prefs.getInt(Constants.WIDGET_TEXT_COLOR, Color.WHITE);
textColor = prefs.getInt(Constants.WIDGET_TEXT_COLOR, getResources().getColor(R.color.colorPrimary));
updateTextColor();
formula.setText("15,937*5");

View File

@ -62,7 +62,7 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calculator {
cxt = context;
updateWidgetIds();
prefs = initPrefs(cxt);
final int defaultColor = cxt.getResources().getColor(R.color.dark_grey);
final int defaultColor = cxt.getResources().getColor(R.color.text_grey);
final int newBgColor = prefs.getInt(Constants.WIDGET_BG_COLOR, defaultColor);
final int newTextColor = prefs.getInt(Constants.WIDGET_TEXT_COLOR, Color.WHITE);

View File

@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dark_grey"
android:background="@color/buttons_background"
android:orientation="vertical"
android:theme="@style/MainTheme"
tools:context=".MainActivity">
@ -15,6 +15,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2.1"
android:fontFamily="sans-serif-light"
android:gravity="right|bottom"
android:lines="1"
android:paddingLeft="@dimen/activity_margin"
@ -27,6 +28,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.8"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical|right"
android:lines="1"
android:paddingLeft="@dimen/activity_margin"

View File

@ -1,9 +1,10 @@
<resources>
<style name="MyButton" parent="Widget.AppCompat.Button">
<item name="android:textColor">@android:color/white</item>
<item name="android:textColor">@color/colorPrimary</item>
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
<item name="android:textSize">@dimen/button_text_size</item>
<item name="android:fontFamily">sans-serif-light</item>
</style>
</resources>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF0000</color>
<color name="dark_grey">#88000000</color>
<color name="dark_grey_pressed">#aa000000</color>
<color name="dark_grey_pressed_mask">#22000000</color>
<color name="colorPrimary">#ffff6f00</color>
<color name="colorPrimaryDark">#ffe46300</color>
<color name="colorAccent">@color/colorPrimary</color>
<color name="buttons_background">#05000000</color>
<color name="text_grey">#77000000</color>
<color name="dark_grey_pressed_mask">#11000000</color>
</resources>

View File

@ -11,9 +11,10 @@
</style>
<style name="MyButton" parent="Widget.AppCompat.Button">
<item name="android:textColor">@android:color/white</item>
<item name="android:textColor">@color/colorPrimary</item>
<item name="android:background">@drawable/button</item>
<item name="android:textSize">@dimen/button_text_size</item>
<item name="android:fontFamily">sans-serif-light</item>
</style>
<style name="MyWidgetConfigTheme" parent="@style/AppTheme">