diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7263039f..ac14929f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -31,7 +31,8 @@ + android:name=".MyWidgetConfigure" + android:theme="@style/MyWidgetConfigTheme"> diff --git a/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MainActivity.java b/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MainActivity.java index 30769938..b543686f 100644 --- a/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MainActivity.java +++ b/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MainActivity.java @@ -1,5 +1,6 @@ package calculator.simplemobiletools.com.simple_calculator; +import android.content.res.Resources; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; @@ -21,6 +22,13 @@ public class MainActivity extends AppCompatActivity implements Calculator { setContentView(R.layout.activity_main); ButterKnife.bind(this); calc = new CalculatorImpl(this); + setupResultView(); + } + + private void setupResultView() { + final Resources res = getResources(); + result.setBackgroundColor(res.getColor(android.R.color.white)); + result.setTextColor(res.getColor(R.color.dark_grey)); } @OnClick(R.id.btn_plus) diff --git a/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MyWidgetConfigure.java b/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MyWidgetConfigure.java index 1dcb0214..b9a66361 100644 --- a/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MyWidgetConfigure.java +++ b/app/src/main/java/calculator/simplemobiletools/com/simple_calculator/MyWidgetConfigure.java @@ -4,11 +4,15 @@ import android.appwidget.AppWidgetManager; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.Button; +import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; public class MyWidgetConfigure extends AppCompatActivity { + @Bind(R.id.btn_reset) Button resetBtn; private int widgetId; @Override @@ -17,6 +21,7 @@ public class MyWidgetConfigure extends AppCompatActivity { setContentView(R.layout.widget_config); ButterKnife.bind(this); + resetBtn.setVisibility(View.VISIBLE); final Intent intent = getIntent(); final Bundle extras = intent.getExtras(); if (extras != null) { diff --git a/app/src/main/res/drawable/button.xml b/app/src/main/res/drawable/button.xml new file mode 100644 index 00000000..08b222b1 --- /dev/null +++ b/app/src/main/res/drawable/button.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/app/src/main/res/drawable/button_normal.xml b/app/src/main/res/drawable/button_normal.xml new file mode 100644 index 00000000..e42ad7d5 --- /dev/null +++ b/app/src/main/res/drawable/button_normal.xml @@ -0,0 +1,6 @@ + + + + diff --git a/app/src/main/res/drawable/button_pressed.xml b/app/src/main/res/drawable/button_pressed.xml new file mode 100644 index 00000000..4953286c --- /dev/null +++ b/app/src/main/res/drawable/button_pressed.xml @@ -0,0 +1,6 @@ + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 7263e189..0e2fccb9 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -4,18 +4,21 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingTop="@dimen/activity_margin" tools:context="calculator.simplemobiletools.com.simple_calculator.MainActivity"> + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginBottom="80dp" + android:layout_marginLeft="@dimen/activity_margin" + android:layout_marginRight="@dimen/activity_margin" + android:layout_marginTop="@dimen/activity_margin"> -