Skip to content

Commit

Permalink
Committing UI improvements and more.
Browse files Browse the repository at this point in the history
  • Loading branch information
edmarjsg committed Aug 23, 2015
1 parent 1d2dca2 commit b56d7e8
Show file tree
Hide file tree
Showing 29 changed files with 186 additions and 108 deletions.
7 changes: 4 additions & 3 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 26 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions BasicUnitConverter.iml

This file was deleted.

11 changes: 9 additions & 2 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
Expand Down Expand Up @@ -71,6 +71,9 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
Expand All @@ -86,8 +89,12 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-22.2.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-22.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
<orderEntry type="module" module-name="commons-lang3-3.3.2" exported="" />
</component>
</module>
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
android:parentActivityName=".BasicUnitConverterActivity"
android:theme="@style/TemperatureTheme"
android:windowSoftInputMode="stateVisible|adjustResize"
android:icon="@drawable/ic_thermometer">
android:icon="@drawable/ic_temperature">

<!-- Parent activity meta-data to support API level 7+ -->
<meta-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
Expand Down Expand Up @@ -43,7 +44,7 @@ public abstract class AbstractConverter extends Activity implements Converter {
private AutoCompleteTextView textInput;
private Spinner toSpinner;
private Spinner fromSpinner;
private Button calculateBtn;
private ImageButton calculateBtn;
private boolean isFirstSelection = true;
private TextView textOutput;
private Resources res;
Expand Down Expand Up @@ -80,7 +81,7 @@ protected void onCreate(Bundle savedInstanceState, Context ctx,

textInput = (AutoCompleteTextView) findViewById(R.id.textInput);
fromSpinner = (Spinner)findViewById(R.id.fromSpinner);
calculateBtn = (Button) findViewById(R.id.calculateBtn);
calculateBtn = (ImageButton) findViewById(R.id.calculateBtn);
textOutput = (TextView) findViewById(R.id.textOutput);

Log.i(TAG, "Adding " + TABLE_NAME + " to autocomplete view");
Expand Down
Binary file added app/src/main/res/drawable-hdpi/ic_calculator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_calculator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/src/main/res/drawable-v21/ripple.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight">
<item android:id="@android:id/mask" android:drawable="@android:color/white"/>
<item android:drawable="@color/greenBackground"/>
</ripple>
Binary file added app/src/main/res/drawable-xhdpi/ic_calculator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/circularButton.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape android:shape="oval">
<solid android:color="@color/colorAccent"/>
</shape>
</item>
<item android:state_pressed="true">
<shape android:shape="oval">
<solid android:color="@color/darkColorAccent"/>
</shape>
</item>
</selector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ripple.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="?attr/colorControlHighlight"></solid>
</shape>
</item>
<item>
<shape>
<solid android:color="@android:color/white"/>
</shape>
</item>
</selector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/roundButton.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/colorAccent" />
<corners android:bottomRightRadius="8dip"
android:bottomLeftRadius="8dip"
android:topRightRadius="8dip"
android:topLeftRadius="8dip"/>
</shape>
10 changes: 6 additions & 4 deletions app/src/main/res/layout/activity_area_converter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,19 @@
android:prompt="@string/from_prompt" />
</LinearLayout>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:text="Calculate"
android:id="@+id/calculateBtn"
android:textColor="#FFFFFF"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="@drawable/ic_calculator"
android:layout_gravity="center_horizontal"
android:textSize="30dp" />
android:background="@drawable/circularButton"
android:elevation="4dp"/>

<TextView
android:layout_width="wrap_content"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_basic_unit_converter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
android:layout_height="155dp"
android:id="@+id/temperatureBtn"
android:layout_width="155dp"
android:background="@color/greenBackground"
android:background="@drawable/ripple"
android:layout_gravity="center"
android:src="@drawable/ic_thermometer"
android:src="@drawable/ic_temperature"
android:scaleType="fitStart"
android:soundEffectsEnabled="true"
android:clickable="true"
Expand All @@ -55,7 +55,7 @@
android:layout_gravity="center"
android:src="@drawable/ic_area"
android:scaleType="fitStart"
android:background="@color/greenBackground"
android:background="@drawable/ripple"
android:clickable="true"
android:elevation="3dp"
android:onClick="onClick"
Expand All @@ -77,7 +77,7 @@
android:layout_gravity="center"
android:src="@drawable/ic_length"
android:scaleType="fitStart"
android:background="@color/greenBackground"
android:background="@drawable/ripple"
android:clickable="true"
android:elevation="3dp"
android:onClick="onClick"
Expand All @@ -99,7 +99,7 @@
android:layout_gravity="center"
android:src="@drawable/ic_time"
android:scaleType="fitStart"
android:background="@color/greenBackground"
android:background="@drawable/ripple"
android:clickable="true"
android:elevation="3dp"
android:onClick="onClick"
Expand All @@ -121,7 +121,7 @@
android:layout_gravity="center"
android:src="@drawable/ic_volume"
android:scaleType="fitStart"
android:background="@color/greenBackground"
android:background="@drawable/ripple"
android:clickable="true"
android:elevation="3dp"
android:onClick="onClick"
Expand All @@ -143,7 +143,7 @@
android:layout_gravity="center"
android:src="@drawable/ic_weight"
android:scaleType="fitStart"
android:background="@color/greenBackground"
android:background="@drawable/ripple"
android:clickable="true"
android:elevation="3dp"
android:contentDescription="@string/converter_weight"
Expand Down
24 changes: 13 additions & 11 deletions app/src/main/res/layout/activity_length_converter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@
android:prompt="@string/from_prompt" />
</LinearLayout>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Calculate"
android:id="@+id/calculateBtn"
android:textColor="#FFFFFF"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center_horizontal"
android:textSize="30dp" />
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:text="Calculate"
android:id="@+id/calculateBtn"
android:textColor="#FFFFFF"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="@drawable/ic_calculator"
android:layout_gravity="center_horizontal"
android:background="@drawable/circularButton"
android:elevation="4dp"/>

<TextView
android:layout_width="wrap_content"
Expand Down
24 changes: 13 additions & 11 deletions app/src/main/res/layout/activity_temperature_converter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@
android:prompt="@string/from_prompt" />
</LinearLayout>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Calculate"
android:id="@+id/calculateBtn"
android:textColor="#FFFFFF"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center_horizontal"
android:textSize="30dp" />
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:text="Calculate"
android:id="@+id/calculateBtn"
android:textColor="#FFFFFF"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="@drawable/ic_calculator"
android:layout_gravity="center_horizontal"
android:background="@drawable/circularButton"
android:elevation="4dp"/>

<TextView
android:layout_width="wrap_content"
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/activity_time_converter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@
android:prompt="@string/from_prompt" />
</LinearLayout>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:text="Calculate"
android:id="@+id/calculateBtn"
android:textColor="#FFFFFF"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="@drawable/ic_calculator"
android:layout_gravity="center_horizontal"
android:textSize="30dp" />
android:background="@drawable/circularButton"
android:elevation="4dp"/>

<TextView
android:layout_width="wrap_content"
Expand Down
Loading

0 comments on commit b56d7e8

Please sign in to comment.